Our wordpress site has the Marketo munchkin code. I'd like to be able to pass something like this to ALL pages and set a cookie which I can then recall when we actually put an embedded form on another page
1. Visitor enters the site via this url:
http://abcxyz.com/directory/?source=value
2. If source Cookie has not been set with the value
3. Later, the visitor goes to a nonMarketo page with an embedded Markto form. Form queries the cookie value and sets it to a hidden field (Lead Source).
Can someone point me out to an article about this if it's already been answered? I looked and didn't really find it.
P.S. Ideally, I'd like to insert this code in google tag manager.
Hi Patrick,
This is very possible and many Marketo users have done this. You'll need to work with your engineers to write the script that reads the cookies and populates the field values with the cookie value. They should be able to make it so that it works on *.abcxyz.com and is therefore both Marketo and corporate site friendly.
And yes, you'll be able to reference the javascript call in Google Tag Manager.
I wouldn't bother with a cookie here if it's all on the same origin. That's just more libraries to load (though I've written my own cookie library in the past, going with widely-used libraries is a better bet, but you end up with another script include).
What you're talking about is saving the source query param when you first see it (not overwriting it), then injecting it into each form. Like so: MktoForms2 :: Touch to Field
I'm not going to recommend GTM for anything. Where you load the script(s) from is up to you.