_mkto_trk hidden field population issue

Josh_Soffe2
Level 2

_mkto_trk hidden field population issue

Hi All,

I'm having an issue on our corporate website of capturing the _mkto_trk value within a hidden field, from the cookie dropped by the Munchkin.js script. It seems to be sporadically appearing and this is obviously an issue that impacts Anonymous > Known attribution. Can anyone help?

Image below of location of form :

Website image.PNG

11 REPLIES 11
Josh_Hill13
Level 10 - Champion Alumni

Re: _mkto_trk hidden field population issue

What exactly do you want to do?


Marketo itself handles Anon > Known so you shouldn't have to manually deal with that.

Josh_Soffe2
Level 2

Re: _mkto_trk hidden field population issue

Hi Josh,

I’d like to pull in the Marketo Cookie ID as per the ‘Server Side Post’ setup the mktotrk field on my form in order to aatribute past web behaviour to the known lead that is generated in the system.

Josh Soffe

Marketing Technology Manager

BAE Systems Applied Intelligence

Grant_Booth
Level 10

Re: _mkto_trk hidden field population issue

Hey Josh,
Could you describe how the form is built? Is it possible that the form is loading on the page after the munchkin script has already executed, at least some of the time (i.e. a racing issue)?

Josh_Soffe2
Level 2

Re: _mkto_trk hidden field population issue

Hi grant,

Thanks for reaching out.

The form loads in a light box on clicking the contact button. This even would indeed happen after the script has loaded. The form is a server side post you can take a look at the form using the screenshot I supplied below?

Sent via Email+ secured and managed by MobileIron

SanfordWhiteman
Level 10 - Community Moderator

Re: _mkto_trk hidden field population issue

First, server-side post is not really recommended.  The "form proxy" pattern (client --> your server --> Marketo's server) is rate-limited and complex, and typically unnecessary.

The mkto_trk cookie is generated in the browser, but the Munchkin library needs to have bootstrapped, downloaded, and initialized first, and if you are using excessive and/or broken asynchronous loading, this may not complete before the form is populated.

But a screenshot isn't really possible to troubleshoot.  We need the actual URL.  Is this https://www.baesystems.com? I don't see Munchkin even attempting to load there.

Josh_Soffe2
Level 2

Re: _mkto_trk hidden field population issue

Hi Sanford,

The form appears in a pop-up after clicking the ‘Contact Sales’ button about halfway down this site http://www.baesystems.com/en/cybersecurity/home (which is tracked by asynchronous JQuery Munchkin)

Josh Soffe

Marketing Technology Manager

BAE Systems Applied Intelligence

SanfordWhiteman
Level 10 - Community Moderator

Re: _mkto_trk hidden field population issue

Well, the _mkto_trk is present in the browser and is sent in the HTTP headers when the form's HTML fragment is requested, but it doesn't end up in the form's hidden field ​_mkt_trk. 

​I assume you expect the ​_mkt_trk ​to be rendered on your server ("burned" into the form HTML, if you will) based on the cookies the server receives in the request.  If so, the bug is in your server code, because it does have the cookie sent to it, but it isn't putting it in the HTML response.

Josh_Soffe2
Level 2

Re: _mkto_trk hidden field population issue

Thanks for the help - I found that as the form was opening in a lightbox that the form HTML was being loaded from an external source so the cookie value wasn't being burned in on page load. Issue is resolved by attached the Munchkin script to the external location so on load (render) the value is attached.

pastedImage_1.png

SanfordWhiteman
Level 10 - Community Moderator

Re: _mkto_trk hidden field population issue

As long as the external location shares a parent domain with the main location (pages.example.com/www.example.com) then the Munchkin cookie will already be in the browser's cookie store.  You don't need to load (nor init()) Munchkin to access the cookie. In fact I don't advise loading Munchkin in an IFRAME like this (which seems to be what you're talking about) because then you see a needless Visit Web Page activity for the LP every time somebody loads the form.