_mkto_trk hidden field population issue | Community
Skip to main content
Josh_Soffe2
Level 2
March 2, 2016
Question

_mkto_trk hidden field population issue

  • March 2, 2016
  • 2 replies
  • 4008 views

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 :

2 replies

Josh_Hill13
Level 10
March 2, 2016

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
March 2, 2016

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 9
March 2, 2016

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
March 7, 2016

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.

SanfordWhiteman
Level 10
March 7, 2016

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.

Josh_Soffe2
Level 2
March 16, 2016

Update: After some further testing it appears that the cookie value is only 'burned in' once and this on the initial munchkin load. The forms are non-marketo embedded forms, loaded in lightboxes. The munchkin script was running (once) on page load and not attaching the cookie ID value to the hidden _mkt_trk field. Thus we have two options available:

Option 1: Use responsive Marketo forms 2.0 adopting the same styling as the current page

Option 2: Use simple script that on form load, pulls the Munchkin ID from the cookie parameter and puts into the _mkt_trk field e.g.

var cookie_val = $.cookie("name");
$
('input[name=cookie]').val(cookie_val);