Re: Adding GA Source/Medium data to a lead without UTMs

Dave_Hancock
Level 2

Adding GA Source/Medium data to a lead without UTMs

I read through the integration guide for Google Analytics​ hoping that cross populating ID's from Marketo to GA would answer my question.  However, it looks like the only way to get Source/Medium data is to use UTM parameters in the URL.  What I would like to confirm is - at the time of a form completion (ours are embedded on our site pages), is it possible to capture Source/Medium data onto a lead record if there are no UTM parameters present?  We are interested in tracking the source of the session, regardless of where they convert.  If this is covered somewhere, I would greatly appreciate a quick link.  Thanks for the help!

Tags (1)
3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Adding GA Source/Medium data to a lead without UTMs

You can do this by persisting (saving) the original UTM parameters (and, optionally, the original document.referrer value) into cookies.

Marketo Forms have built-in support for AutoFill from individual cookies, though I find that kind of sloppy and prefer to save all values to a single cookie, then parse out the values into hidden fields when there's a form that needs them.

(As I always mention, Referrers will not be sent from HTTPS sites unless your landing pages are also running HTTPS. Not just having HTTPS available in general -- the links people follow have to be the https:// version.)

Dave_Hancock
Level 2

Re: Adding GA Source/Medium data to a lead without UTMs

Hi Sanford,

    Thanks for the quick reply.  Persisting the UTM tags makes sense to keep the values in the session.  Where I'm stumped is if they don't exist to start.

My thinking might be oversimplified, but if GA is able to assign a session to a particular medium as the session starts (and maintains that value across the session), then I would like to be able to pull that data point across at the time a form is submitted.

SanfordWhiteman
Level 10 - Community Moderator

Re: Adding GA Source/Medium data to a lead without UTMs

Well, session data of some sort always exists to start since GA has no more to go on than Marketo at the start of a session (current URL host/path/query+ referrer URL host/path/query).  Some of that information, if added by Google itself, is purposely opaque, but it's not that it doesn't exist in the URL/

You seem to be saying you want to retrieve previously saved data from the GA tracker.  This is unfortunately not possible AFAIK.  Realize that the data is sent to GA and then is keyed on the GA session identifier(s): it's not stored in the browser anymore after that point.  There's a real-time API that may be able to retrieve it back into the browser (with rate limits) but I doubt that would be easier than simply persisting the values yourself.