Re: Marketo Tracking Token Across Multiple Domains

DanMoczisko
Level 1

Marketo Tracking Token Across Multiple Domains

Hello,

 

We recently updated our domain and are attempting to keep tracking across both domains. Using this older thread: https://nation.marketo.com/t5/Product-Discussions/Munchkin-Tracking-Multiple-Sites/td-p/132194 and the postMessage API I have been able to set up cross domain cookie tracking, however I am a bit stuck on the next steps.

 

I see "_mkto_trk" and am wondering if this is the correct key to target, and if so, what is the recommended practice for doing this. It looks like if a visitor hasn't opted into any material (filled out form) marketo still assigns a value to this cookie. Would it make sense to see if "old domain cookie value exists" and then extract that value and replace "new domain cookie value" with the old one? Will this allow for leads to be tracked across domains?

 

Thanks in advance

9 REPLIES 9
Josh_Hill13
Level 10 - Champion Alumni

Re: Marketo Tracking Token Across Multiple Domains

Did you check developers.marketo.com?

 

My understanding was that on multiple sites, the Lead will be assigned multiple cookies. They won't be merged until the Lead fills out a form on two or more sites with the same email address.

 

(assuming dupes aren't an issue here).

DanMoczisko
Level 1

Re: Marketo Tracking Token Across Multiple Domains

I have checked there. I understand that the lead will be assigned multiple cookies. We would like to avoid having them opt in again if they already have on the old domain and also do not lose any previous visitor tracking associated with that web activity.

SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo Tracking Token Across Multiple Domains

That is the right cookie name, but you can't simply overwrite the current cookie value, because it will be formatted for the original domain. You have to also set the visitorToken init option to the value of the cookie (which will then ignore the formatting discrepancy).

DanMoczisko
Level 1

Re: Marketo Tracking Token Across Multiple Domains

Thank you for the reply and forgive my ignorance but just so I understand the entire process correctly:

1. Read _mkto_trk value from previous domain

2. Extract _mkto_trk value from previous domain for use on new domain

3. Set visitorToken init option to the value of the _mkto_trk cookie value: Something like initMunchkin(); as seen here:https://developers.marketo.com/javascript-api/lead-tracking/

 

Is this the correct sequence of events? And if the lead has the cookie from the previous domain then we can merge all of the tracking data together, without requiring the lead to opt in again?

 

Thanks in advance for all your help.

SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo Tracking Token Across Multiple Domains

Yes, that's the process.

 

Though when the same token is being used, it's not really a "merge", it's literally putting activity log entries under exactly the same key in the database. The db reflects it as the same continuous session, it has no way of knowing how the key was constructed on the client.

Chris_Francis
Level 4

Re: Marketo Tracking Token Across Multiple Domains

I do not see visitorToken as a documented property for options of the .init function. (https://developers.marketo.com/javascript-api/lead-tracking/configuration/)  Is this simply an undocumented feature?

SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo Tracking Token Across Multiple Domains


Is this simply an undocumented feature?

Correct.

Chris_Francis
Level 4

Re: Marketo Tracking Token Across Multiple Domains

Thanks @SanfordWhiteman  Last question I promise.  What is the format of visitorToken?

If it just the token portion of the cookie:

Munchkin.init('AAA-BBB-CCC',{ visitorToken: '_mch-oranges.com-1234567890123-45678' });

Or is it the entire cookie:

Munchkin.init('AAA-BBB-CCC',{ visitorToken: 'id:123-ABC-456&token:_mch-oranges.com-1234567890123-45678' });

 

anissabrach
Level 2

Re: Marketo Tracking Token Across Multiple Domains

Hi @DanMoczisko were you successful with this in the end? I'm looking at something similar, but unsure where to start.