smugglerFlynn
smugglerFlynn

Reputation: 6654

Getting referral and campaign information from Google Universal Analytics

We use Google Tag Manager on our site, which uses Universal Analytics to track our customers.

The goal is to fetch referral information for specific customer in realtime when he signs up, so we can store that source in the database.

With older ga.js tracking script some information could be fetched from the cookies, like it has been described here. However, Universal Analytics does not store any meaningful information in the cookies, and we need the alternative.

What is the easiest way to track the following information realtime?

  1. Referral URL for specific Analytics user
  2. Originating traffic category for that user (like 'Google / organic' and so on)

Upvotes: 3

Views: 1799

Answers (1)

Eike Pierstorff
Eike Pierstorff

Reputation: 32760

You cannot get that information in real-time from Google Universal Analytics. Campaign attribution now happens server-side and there is no real-time back-channel that would provide campaign information.

However Google documented their attribution model, so you can build a script that mimics their attribution flow (with a few small exceptions; for example Google attributes recurring users that come via direct type-in to a previously stored marketing channel. You do not have that previous information).

The attribution process is laborious but not difficult (check for campaign parameters; if there are none check referer for known search engines, etc). This will not give you a 100% match with the information in GA but will be close enough.

Alternatively you can forego the realtime requirement. Store a token as custom dimension in GA and the same token in your CRM on signup. Do a GA query that returns token and campaign information once a week or so and join this with your CRM database with the user token as key. As per Googles TOS that token must not contain personally identifiable information.

Upvotes: 5

Related Questions