I'm happy to provide more specific information if needed but basically:
1) User submits form
2) We push lead to Marketo using REST API (/rest/v1/leads/push.json)
3) We associate munchkin with the lead with REST API (/rest/v1/leads/{leadId}/associate.json)
How do I check if this munchkin has been successfully associated?
Also, you're already using 2 REST API calls for something the Forms 2.0 JS API can do with zero API calls.
Have you been thinking about the DoS vulnerability here?
Yes, I have seen you bring this up in other forum posts.
I will bring this up and discuss it further with some of my more experienced colleagues. I think the reason we are trying to use the REST API is so we can move the Marketo interactions to our backend. This way we don't have to worry so much about ad-blockers preventing us from interesting with Marketo.
This way we don't have to worry so much about ad-blockers preventing us from interesting with Marketo.
Doesn't make sense. You're not going to have a Munchkin cookie if an ad blocker blocks marketo.com and mktoresp.com.
A Marketo form can work with an ad blocker running b/c it's not necessary for it to have any reference to Marketo-operated domains.
If the cookie exists at all, then a successful call to the Associate Lead endpoint means it was associated.
You do not want to be checking the cookies field after every association, that would be a worst practice.
Thanks so much for the quick response Sandford.
Yes, I will not be deploying a check of the cookies field into prod however, when I tried to check it to see if it was working correctly it's value was null. Does that mean it hasn't been associated?
The way I tried to check was again with the REST API (/rest/v1/lead/{leadId}.json?fields=cookies`).
That is indeed the way to spot-check. Are you sure you URL-encoded the cookie value correctly?
I am not sure TBH. I am currently grabbing the _mkto_trk cookie value and passing that through so is request looks something like:
https://000-aaa-777.mktorest.com/rest/v1/leads/1234567/associate.json?cookie=id:000-AAA-777&token:_m...
I am currently grabbing the _mkto_trk cookie value and passing that through so is request looks something like:
https://000-aaa-777.mktorest.com/rest/v1/leads/1234567/associate.json?cookie=id:000-AAA-777&token:_m...
You can't send the token unencoded like that, the "&" is going to break the query string into two parts, by definition.
You must always, always URI encode any query param name or param value.
Ahhh, thank you so much! That was the issue. You have helped me a lot.
@Dev_Team pls return to the thread and mark one of my answers as the Solution, thanks.
Ahhh, thank you so much! That was the issue. You have helped me a lot.
OK, pls mark one of my answers as the Solution, thx.