How to store GCLIDs into a custom dimension in Google Analytics

GCLID’s by default are not available in Google Analytics. We had many clients wanting to store GCLID‘s into a custom dimensions in Google Analytics. There are multiple ways of doing this but the easiest way is using Google Tag Manager. Check out our how to and learn how to do it in 5 minutes.

 

Using Google Tag Manager:

 

If you are on Shopify you are forced to another approach. Simply follow up the custom dimension in Google Analytics. After doing so, head to your Online Store settings and update your Google Analytics setting to the following:

shopify gclid upload to ga

 

Here is the code from the screenshot above:

var gclid = window.location.search;
var gclid = gclid.match("gclid=(.*).")[1];
ga('set', 'dimension9', gclid);

It’s important of course to change the ID of the dimension to your ID. In this case the ID is 9.

 

You might also like to read:

How to Connect Google Analytics to Microsoft Power BI 

How Do You Tag Facebook Ads For Google Analytics?

How to connect Google Analytics to your CRM system?