Offline Attribution: Why it’s important & how to do it using GA

  ●   January 27, 2020 | Analytics, Blog
Written by
January 27, 2020 | Analytics, Blog

Why You Should Care

When discussing attribution there are a number of avenues you could explore, from the models to the various methods. However, in this article, we look to explore why it is so important to understand your offline activity when adopting an omni channel approach, as well as some invaluable logic & tips  to help you achieve this.

First of all, let’s explore the importance of having a holistic view of both online and offline performance. Data-driven decisions are at the core of everything we do as an agency, therefore having visibility over our clients’ performance across all channels is paramount when informing our strategies. By implementing the strategies below we have been able to fully understand and learn which channels and campaigns are resonating best and help inform our on-going decisions to yield our award-winning results.

At the core of this, the main issue is that analytics tools like GA and Adobe Analytics can handle on-site attribution using their various models (e.g. cookies, UTMs etc), but what happens once the customer interactions go offsite? They may have “converted” by requesting a demo or contacting sales, but do you have the visibility to know what happens after? Did they generate any revenue? Or just drop out of the funnel? Unfortunately, a large number of companies cannot answer these questions and could, therefore, be wasting a large chunk of their budget on a channel which only generates quantity not quality.

Utilising API functionality such as GA’s Measurement Protocol, enables you to  send custom hits into Google Analytics after the user has left the site. This can then inform your reporting on the final outcome following the initial “conversion” they completed previously. There are endless configurations to achieve this, but next we will go into the logic and some potential nuances you may come across.

Data-driven decisions are at the core of everything we do as an agency, therefore having visibility over our clients’ performance across all channels is paramount when informing our strategies.

The Method

Now, to start this process, one of the most important factors is to have a unique key between both of your data sets. This will allow you to merge your two data sets and correctly attribute your offline data against the same user’s online data; when looking at GA, the unique key is typically the Client ID or the User ID. There are two main ways to read this ID: either by reading the “_ga” cookie or by accessing the GA tracker on site. 

The function below can help search for the correct ID if you have multiple GA accounts active on the same page:

function ClientID () {

  try {

    var trackers = ga.getAll();

    var c, length;

    for (c = 0, length = trackers.length; c < length; c += 1) {

      if (trackers.get(‘trackingId’) === ‘YOUR GA UA CODE’) {

        return trackers.get(‘clientId’);



  } catch(e) {}  

  return ‘No Client ID Found’;


This can be adapted to be used via your site as a function or via GTM as a variable and should then be stored in your backend sales system as well as a GA custom dimension. 

Tip: We recommend adding a letter to your Client ID or preserving the “GA1.2.” prefix when storing in a custom dimension/CRM field. This will ensure the value is seen as text and therefore will not be truncated or rounded when exporting to Excel, for example.

As mentioned before, the User ID can also be used instead of the Client ID to get the cross-device user overview but this is not always available depending on your setup.

Once these have been collected and are being stored in your CRM or sales system, the next decision you need to make is what you want to send into Google Analytics. For example, if you want to send an event hit with a lead’s current status you need to build a GA hit, such the example below.

This hit would generate an event for a qualified lead that is looking to purchase service 𝑥 for a value of 50,000. This event can then be used as part of a goal or analysed as an event using the event value metric.

In addition to the Client ID or unique key of choice, Measurement Protocol has a number of extra parameters you must include for GA to process your hit.

More information on all parameters and their requirements can be found within Google’s documentation linked here.

No we have our base event parameters, we also recommend including some additional parameters but this is down to preference. These parameters include:

Tip: When sending an event hit, the non-interaction parameter is key to avoid inflating your sessions. As standard, if you send an event to Google Analytics, it will create a session alongside this. By using the non-interaction parameter you create an event but no session. This is vital to prevent offline behaviour from impacting your online figures.

This hit payload would come out looking something like this: 

v=1&t=event&tid=UA-XXXXX-Y&cid=XXXX&ec=Lead%20Status&ea= Qualified&el=Service%20x&ev=50000&ds= MeasurmentProtocol&cd1=G.A.1.2.XXXX&ni=1

A useful tool to validate these hits is the GA hit builder linked here. With this tool, you can build and send test hits to your own GA accounts (following a quick authorisation check) to see how the data will be displayed in your setup. Some additional considerations may involve your spam filters e.g. for specific hostnames you’d use “dh” and add the parameter to satisfy the filter condition.

Measurement Protocol Specifics

Now we are at the point where we have a hit payload structure planned out and data is being collected in both GA and your CRM. The next consideration is what offline data do you want being sent into GA? A lead status update? Just a final purchase? Or maybe a phone call? Or maybe all of them? This question is pivotal as it will dictate your approach for the final implementation. This logic can help you track final revenue figures as well as lead status updates overtime, therefore, planning from here is key.

As using your CRM/Backend system you should either pull or push data into a place where you can manipulate and push data into GA using the POST/GET endpoint. Details on this endpoint can be found here with the top-level details below:

POST: /collect HTTP/1.1  Host:

This endpoint has a number of restraints (detailed in the link above) such as byte limit for batch responses so this should be reviewed and forecast based on user requirements.

Building Your Reports

Data is being collected and all is going as expected, great. Now for the best bit yielding the insights and finally reaping the benefits from this data. At Semetrical we have a range of clients who use this sort of data in different ways. This includes:

  • ROI reporting to stakeholders
  • Budget allocation analysis
  • On-going activity optimisations.

But before this happens there are a few elements you may need to set up beforehand such as setting up GA goals following your event creation. The creation of these goals will allow importing into platforms such as GoogleAds. This could help assess which of your campaigns are actually doing best from a business objective perspective (which may not be the ones getting the most form submissions).

GA has the functionality to use the event value as your goal value when creating your goal. This means when creating your goals, you will have the revenue figure across all your report to analyse every angle of your performance from device category to landing page and campaign.

The Big Picture

Once all of the steps have been put together you should have a similar flow to the one below linking all the way from the user to reporting revenue:

Once this base functionality has been built, there are endless opportunities to expand your analysis potential. This could include machine learning, ROI optimisations for any paid activity or even data collection for proof of concept when trying to get that elusive budget from your managers!

Psssst. If this seems like a lot of work, we have developed a sophisticated Systematic Attribution of Marketing tool, better know as S.A.M, which can automate this for you! It is compatible with a range of CRMs from Hubspot to Salesforce.

Find out how your business can benefit from the intelligent capabilities of our S.A.M technology to inform smarter strategic decision-making to maximise ROI.

Our Blog