Hey,
Trying to figure out the rule we could add to pass ORIGINAL UTM parameters value from the form hosted on the Marketo LP to the destination page. We need this for our tracking in SFDC.
For example, this is how we use urls in our company: person is coming from facebook and lasnds on this page that hosts Marketo form: www.form-hosting-landing-page.com/?utm_medium=social-paid&utm_source=facebook&utm_campaign=my-campaign
Once someone fills out the form, we would like to pass all utm parameters and destination page to be:
www.destination-page.com/?utm_medium=social-paid&utm_source=facebook&utm_campaign=my-campaign
For any other CTAs on our marketo LP we use this code to pass UTM values: <a class="block pass-query" href="https://www.destination-page.com" target="_blank"><button class="btn btn-orange">Register</button></a>
Can you please advise if the similar function is available for forms as well?
Solved! Go to Solution.
For any other CTAs on our marketo LP we use this code to pass UTM values: <a class="block pass-query" href="https://www.destination-page.com" target="_blank"><button class="btn btn-orange">Register</button></a>
This isn't any kind of built-in browser or Marketo function. You must have separate code on your page that finds <a> tags with this class and rewrites the href.
If you want to add the current page's query string to the Thank You URL of a Marketo form, do it like so:
MktoForms2.whenReady(function(form){
form.onSuccess(function(vals,thankYouURL){
var thankYouLoc = document.createElement("a");
thankYouLoc.href = thankYouURL;
thankYouLoc.search += ( thankYouLoc.search.length ? "&" : "" ) + document.location.search.substring(1);
document.location = thankYouLoc;
return false;
});
});
But I really don't think this is the best way to transport the original UTM information (having just worked with a client late last night whose analytics team was confused by this approach). Far better is persisting the original UTM parameters in a cookie, or at the very least relabeling the parameters as original_utm_whatever so you don't create extra GA sessions.
For any other CTAs on our marketo LP we use this code to pass UTM values: <a class="block pass-query" href="https://www.destination-page.com" target="_blank"><button class="btn btn-orange">Register</button></a>
This isn't any kind of built-in browser or Marketo function. You must have separate code on your page that finds <a> tags with this class and rewrites the href.
If you want to add the current page's query string to the Thank You URL of a Marketo form, do it like so:
MktoForms2.whenReady(function(form){
form.onSuccess(function(vals,thankYouURL){
var thankYouLoc = document.createElement("a");
thankYouLoc.href = thankYouURL;
thankYouLoc.search += ( thankYouLoc.search.length ? "&" : "" ) + document.location.search.substring(1);
document.location = thankYouLoc;
return false;
});
});
But I really don't think this is the best way to transport the original UTM information (having just worked with a client late last night whose analytics team was confused by this approach). Far better is persisting the original UTM parameters in a cookie, or at the very least relabeling the parameters as original_utm_whatever so you don't create extra GA sessions.
Hey Sanford,
We track everything with SFDC using Bizible that requires to have UTM parameters for accurate reporting, therefore only cookies tracking will not work for us.
I didn't say "only" cookies, I said that without cookies you cannot do accurate journey tracking. And this is why Bizible itself uses cookie-keyed persistence.
Also, if you could mark my response with the code as Correct as I assume you've tested it out...
I have wrote code for the same in order to get values via JS from url and push them on another page.
If there's still issue please let me know i can help in passing data.
Thanks
Well, there's code in my earlier response to forward the LP query string to the Thank You URL... if you have an alternate approach, feel free to post it, but it can't be any simpler than the above.