When the incoming traffic comes to our site, on the first instance we get UTM parameters within the URL query string parameter (i.e. utm_campaign=XYZ, utm_source=ABC, utm_medium=facebook, etc.). The problem we're running into is that this query string parameter doesn't fire on the form submissions within the Marketo pages (since it only fires at an entry-perspective). Is there a solution that could somehow track that initial entry parameter when the form is submitted (a number of pageviews down the line)?
There are a number of ways to do this, like my simple UTM forwarder or Yanir's UTM tracking JS.
At this basic level, all the approaches are by nature the same, they just differ in configurability:
[1] persist query parameter to cookie, cookies, localStorage, or sessionStorage
[2] restore to form fields, either using Form Editor's built in Hidden field » AutoFill or Forms API addHiddenFields().
Hi Sanford,
I read your blog post on this and, before I go down the path of implementing your suggestions, I have some questions:
Is this what is necessary for the UTM parameters to be passed through Marketo forms and back into GTM? Essentially the issue we are having (which I believe is the same as the original poster) is that the UTM parameters that are included when someone clicks on one of our advertisements are not being passed through the form. Essentially, upon form submission (our goal conversion), the referrer in GA is showing "mkto-f0095.com / referral" as the Source/Medium in GA rather than the original UTM parameters from when they arrived on the landing page. This means we are unable to correctly track the success of our ads when the forms on our landing pages are being filled.
The solution in your blog post sounds like it saves the UTM parameters in Marketo fields, but doesn't solve the issue with the parameters being passed through for GTM to see. Please correct me if I am wrong. Any help is greatly appreciated!
On a side note, I did have our agency change the tag script from .onsubmit to .onsuccess based on your recommendations on other posts. Thanks!
-Tim
The solution in your blog post sounds like it saves the UTM parameters in Marketo fields, but doesn't solve the issue with the parameters being passed through for GTM to see. Please correct me if I am wrong. Any help is greatly appreciated!
Well, yes and no. If you use my code first before GA, that makes sure that GA initializes after the query string is restored to its original state, hence it will see the UTM parameters. It has no idea that they weren't there when the page started loading, it only knows if they're there by the time GA looks for them.
Good to know! I will go ahead and give your UTM forwarder a shot then. This is the only method that I've come across that sounds like it will solve my specific problem. Thanks for your help!
Hi Sanford,
I've implemented your solution and all seems to be working! We set the forwarder to expire in 1 day. One thing I've noticed is that throughout the day, the URL is building up with lots of "&" symbols as you can see in the screenshot below. Is that just part of the forwarder functionality?
This is live, so you can test it directly on our site (www.XIFIN.com) if you're interested.
Thanks,
Tim
Yeah, that's because the code is (was) deliberately lazy w/URL parsing -- if you grab the code from the post now it doesn't do that.
Hi Sanford, I'm also noticing that it's also forwarding mkt_tok tracking code from emails in addition to utm parameters. Will this negatively affect Marketo's tracking ability/accuracy in any way?
Nope, that's fine.
@SanfordWhiteman you have another very useful solution. Thanks.
We are using a WordPress site for a corporate site, so the desire is to add tags via GTM. Of course it works great on the entry page. Since these fire asynchronously, when we get to the form page, the tag is not firing early enough for the form to see the UTM values. I have tried bumping up the priority, but that isn't consistent either. Do you have any tricks to force a GTM tag to fire before the Forsm2.sj or to delay the Forms2.js?