SOLVED

Re: Updating lead via API doesn't start web tracking

Go to solution
Alex_Golebiewsk
Level 1

Updating lead via API doesn't start web tracking

So I am updating an anonymous lead (after a non marketo form fill) via the API. The data is sent correctly into the lead record but the web tracking via munchkin code/cookie isn't working. Is there any fields I can set in the lead api to have it be treated like a marketo form 2 embeded form submit?

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Updating lead via API doesn't start web tracking

You didn't specify which endpoint you're using, but in any case you need to call the Associate Lead REST API endpoint. (Note the Push Lead REST API endpoint does not completely reproduce the effect of a true form post, contrary to documentation.)

Of course the far better way to do this is to use the Forms JS API to submit a Marketo form in the background.

View solution in original post

5 REPLIES 5
SanfordWhiteman
Level 10 - Community Moderator

Re: Updating lead via API doesn't start web tracking

You didn't specify which endpoint you're using, but in any case you need to call the Associate Lead REST API endpoint. (Note the Push Lead REST API endpoint does not completely reproduce the effect of a true form post, contrary to documentation.)

Of course the far better way to do this is to use the Forms JS API to submit a Marketo form in the background.

Alex_Golebiewsk
Level 1

Re: Updating lead via API doesn't start web tracking

My apologies, I'm using the leads enpoint /rest/v1/leads.json to update the lead and I just saw that there is an associate lead enpoint as well. You would think you could update the lead with a parameter saying associate the lead.

I think you're right about it being easiest to just submit a form, however, for this scenario, I would have to build another form in market since currently there are no fields.

Thank you,

SanfordWhiteman
Level 10 - Community Moderator

Re: Updating lead via API doesn't start web tracking

I would have to build another form in market since currently there are no fields.

You can submit any Marketo form ID with any fields in your instance (as hidden fields added via JS).

Alex_Golebiewsk
Level 1

Re: Updating lead via API doesn't start web tracking

Is there a way to trigger a lead association when a field is updated or a campaign is used?

SanfordWhiteman
Level 10 - Community Moderator

Re: Updating lead via API doesn't start web tracking

Is there a way to trigger a lead association when a field is updated or a campaign is used?

Only if you trigger on Data Value Changes to call a webhook, that calls an external service, that in turn calls back into the Associate Lead API.

Not to say this isn't possible, but if you already are doing things from a client app you might as well do it there.