Blog

Home > Blog > Adwords Offline Conversion Tracking

Adwords Offline Conversion Tracking

Google Adwords recently released an ability to record offline conversions. Doing this in the past was a mess requiring lot of custom code and integration with backend crm system. The new method is much more straight forward not to mention officially sanctioned :). Below is meant as technical intro to the implementation. For all the steps to follow please review the support page

There are 3 main steps to the integration. 1- First you need to add this script to all pages. This detects whenever a user comes from adwords and stores their ad click id (gclid) in a cookie.

Add this code before closing /body>

<script type="text/javascript">
function setCookie(name, value, days){
    var date = new Date();
    date.setTime(date.getTime() + (days*24*60*60*1000)); 
    var expires = "; expires=" + date.toGMTString();
    document.cookie = name + "=" + value + expires + ";path=/";
}
function getParam(p){
    var match = RegExp('[?&]' + p + '=([^&]*)').exec(window.location.search);
    return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}
var gclid = getParam('gclid');
if(gclid){
    var gclsrc = getParam('gclsrc');
    if(!gclsrc || gclsrc.indexOf('aw') !== -1){
        setCookie('gclid', gclid, 90);
    }
}
</script> 

2- The forms on the site need to be updated with a new form field. This field would be hidden on the form itself and a script would be added to the page that will autopopulate it with a google adwords id (gclid).

If you are using a crm / email system like salesforce, infusionsoft, aweber you will need to add the new field in their backend and map it to the new form field.

Set the id of the new form field you created to gclid.

<input type="hidden" id="gclid" name="gclid" value="">

Add this script before /body> on the form page(s).

 <script> 
  function readCookie(name) { 
  var n = name + "="; 
  var cookie = document.cookie.split(';'); 
  for(var i=0;i < cookie.length;i++) {      
      var c = cookie[i];      
      while (c.charAt(0)==' '){c = c.substring(1,c.length);}      
      if (c.indexOf(n) == 0){return c.substring(n.length,c.length);} 
  } 
  return null; 
  } 

  window.onload = function() {      
      document.getElementById('gclid_field').value = 
  readCookie('gclid'); 
  } 
  </script>

This script will autopopulate the new field with gclid.

3- On the backend in your crm you will need to generate a report of people who have converted and have the gclid set this data would then be added to a csv file according google's format and uploaded it to adwords.

This makes it much easier to import offiline conversion data into adwords the actual formatting and upload could be automated as well making this even simpler (this is something we are cooking on for a client, stay tuned)

Share:

Data that Moves Your Business

Connect with Marketlytics

Join 120,000+ Marketers

Stay ahead with expert insights on marketing analysis, data-driven strategies, and industry trends.

Omair

Revenue Growth Analyst
Data Unification Specialist, previously at a leading Ecommerce Giant

Case Studies

Discover our latest success stories
and see how innovative strategies
drive measurable results.

Get a Free Attribution Dashboard

Gain clear insights into what’s
driving conversions and optimize
your marketing spend with ease.

Are you Ready to Fast Track your Marketing Attribution Decisions and Maximize your ROI?

Businesses that leverage automated marketing
attribution see a 20-30% improvement in ad
spend efficiency.