I have been doing some research on this topic and wanted to validate that I am understanding correctly what needs to be done to capture lead source from a URL.
Do I need to create a field labeled: utm source?
Then append URL's with ?utm_source=website to capture the word "website" into the custom UTM Source field?
For example, my team posted a video to our website that is tracked by a munchkin tracking code. I originally had our team append the URL with ?source=website but the information wasn't being transferred to the lead. In doing some research it appears this isn't possible without putting a form on the page with a hidden field to capture this information. So I am thinking the above may be the correct work around?
I appreciate any input on this topic.
Thank you!
I recently had to solve this exact issue at Yesware and wrote an open source library which will do it for you.
Firstly, it's important to understand how UTM parameters work when using Google Analytics. UTM parameters apply to a single visit (session) only. If a user clicks on a link which is tagged, that session will be associated with the UTM parameters. E.g. ?utm_source=adroll&utm_medium=display will place that session into the Display channel within Google Analytics. If the user fills out a form during that session, you'll want to define that as a goal with in GA and you'll be able to see the conversion rate of that channel. If the user doesn't convert and then comes back to your site, you won't want to reuse any previous UTM parameters as they won't be correct.
The previous version of the GA tracking code would save these for you in a cookie named _utmz, but the current version no longer does this.
When a user visits your site with UTM parameters in the URL, you'll want to save these into a cookie which expires at the same time as the GA session, which by default is after 30 minutes of inactivity. If at any time in the session new UTM parameters on the URL are detected, then the previous values should be overwritten as GA has started a new session at this point.
When a user fills out a form (becomes known), you'll want to fire a GA event which is setup as a Goal in GA and also pass the saved cookie values to Marketo.
I've created a library to do the first piece: https://github.com/Yesware/last-campaign
On every page of your site, you would just include the script and call "lastCampaign()", this will save the UTM parameters into a session cookie.
Then on your form you can add hidden fields with populated with the value of the cookies: utm_campaign, utm_medium, utm_source, utm_term, and utm_content. Alternatively, you can use some JavaScript on your landing pages which will automatically add the hidden fields and populate them. Here is an example that will do that for you: https://gist.github.com/lukebussey/c1aeb4113e90c519d522
I hope this is helpful.
Here is an example that will do that for you: https://gist.github.com/lukebussey/c1aeb4113e90c519d522
Cool script! But it has a race condition that a 200ms timeout will not fix. Use the hitCallback as noted here: https://nation.marketo.com/thread/5577#118658. This kind of thing is frequent source of lost logs.
Fantastic. Thanks!
I originally had our team append the URL with ?source=website...
Christine, there's a cool trick in this area that (I think) almost nobody knows about.
If you want to transfer one data point from the URL to a lead field, like lead source in your case, and you don't know the possible data values (or don't want to manage them), add that data point as the s -- just the letter "s" -- query parameter. (Like how you were trying to use the source param.)
http://landing.example.com?param1=whatever&s=linkedin
On the page, fire a simple Munchkin event. In the url include the name of the lead field you want to update to the value of s. Here, Munchkin is signaling that you're setting the lead field utm_source to the current value of s ("linkedin").
Munchkin.munchkinFunction('visitWebPage', { url: '/dataValueTransfer/utm_source' });
Your Smart List watches for any visit to /dataValueTransfer/...
... and your Flow sets data values accordingly:
The advantage of this quick-and-dirty method should be easy to see: the value you're putting on the lead is available as a special trigger token {{trigger.Search Query}}! (The s query param is the old-school way that search engines would tell you the search terms the user entered, back when they didn't care if you knew.) Since you have the token, you don't need to know the possible values, so it's a lot like a form post with a single field. It could contain any value at all (s=blee, s=blah, s=somethinganoutsideagencydidnttellyouaboutbutthatsokay) and that value will get popped into the corresponding value on the lead.
Anyway, food for someone's thought, I hope... not a fit for more complex situations but I thought I'd share it!
Note: You can actually adapt this same technique for multiple values per page view, though in uplevel browsers only. Since that excludes IE 8-9 I won't include the method here to make sure everything is compatible.
Hi Sanford - great post.
Why wouldn't you just do a "Change data value" on Lead Source to {{trigger.search query}} when a fills-out-form is completed?
I think I'm having trouble understanding what the query paramater ?s is all about.
Edit: because the Trigger.Search Query only works on a 'Visits web page' trigger right?
Edit: because the Trigger.Search Query only works on a 'Visits web page' trigger right?
Right! Specifically, in this case, the manual call to Visit Web Page sets the referrer to the current document (as opposed to the previously navigated document), so the s of the current doc becomes the {{trigger.search query}}.
And of course the reason this is cool is that you don't need to wait for a form fillout or other moment to save the information to the lead, or more properly with Munchkin 2.0, "prepare the information to be saved to the lead at the moment it is promoted from anonymous."
could we use this technique especially to set the email address and therefore to promote a lead to become known ?
-Greg
could we use this technique especially to set the email address and therefore to promote a lead to become known ?
It won't work for lead promotion. In that case you would use either Munchkin API associateLead or Forms API hidden submit. I really prefer Munchkin associateLead, but you can't do that purely client side. I'm writing up a blog post on how to track non-Marketo email clicks (for which I almost exclusively use associateLead, but since those are emails you are able to securely precompute the Munchkin "associator token").
Hi Christine
You can capture the value "website" in any Marketo field. You can create a field "utm source" or use the default field "lead source", if you want.
To capture the data, you need to add this field to your forms, as hidden a field, then set the field value to be a URL parameter, and set the url parameter name to utm_source.
-Greg
Thank you, Gregoire for your response.
What if the page I am trying to capture the source from does not contain a Marketo form? I understand the hidden form field capture, I'm trying to capture certain source codes from the URL.
Thank you,
Christine
Hi Christine,
Do you mean the entry page on the site does not contain any form or the page does contain a form that is not a Marketo form ?
-Greg
Hi, I mean the page does not contain any form.
So it sounds like I need to add some java script? Do you have any documentation you could send me about this?
Thank you again for your help!
Christine
Sounds like the majority of this activity will be anonymous, correct? If so, then your options are pretty limited on what you can report out of Marketo - and even more so after next weekend's release - when the "is anonymous" filters are removed from smart lists (Removal of "Is Anonymous" filters.). You'll have to rely on Google Analytics (or other platforms, like DemandBase) for anonymous activity beyond what you will still be able to achieve in the Web Page Activity Report and the Company Web Activity Report.
Hi Dan,
You can also use cookies to store at least the first set of UTM's in permanent cookies (live span 2 years) and capture them later when the lead converts.
You then can use cookies to store the most recent set of UTM's in session cookies (live span session) and capture them in Marketo when the lead converts again.
With all this, you can get easily :
It just take some JS to do it.
It remains very complementary to GA, as, for instance, this will never give you accurate info about which channels convert and which don't.
-Greg
Agree - I'm familiar with the basic approach here. It sounded like there was some urgency around this and wanted to set the expectation that - without js - your options are very limited if the intention is to identify lead source of anonymous users.
Hi again Dan
Fully agree with you on this
-Greg
Thank you both!
Do either of you have a recommendation of where to look or what to search for in the community for helpful guides to set up the javascript?
Hi Christine,
Sanford Whiteman or Courtney Grimes will probably be the most skillful persons on this matters.
-Greg
Thank you, Gregoire.
Sanford Whiteman and Courtney Grimes do either of you have any helpful information you could send me about capturing lead source using JavaScript?
Courtney I have read your post about integrating Google Analytics and Marketo, which has been extremely helpful in outlining the relationship between the two systems, thank you for that. If I am understanding correctly, integrating Google Analytics and Marketo may address my original question about capturing lead source. Also upon further reading, it looks like some Marketo users use Google Tag Manager to tie lead source back to Marketo ID, is that correct?
I feel like I am asking a lot of questions and trying to tie numerous scenarios together, any other advice or definition around the integration would be helpful.
Thank you!
Christine
Google Tag Manager has nothing to do with integration with Google Analytics. GTM is way for you to efficiently deploy various tracking code across specific pages (or quickly across all pages) of your site (and Marketo LPs). For example, we use GTM to centrally manage the deployment of Munchkin, DemandBase, Google Analytics, and any temporary paid advertising tracking code.