Google Analytics by default attributes the last known source to the User. But what if you wanted to know which source initially led to a conversion?
In this video, Julius from AnalyticsMania will show us how we can track the initial source of traffic, save it to a cookie and port it into a custom Dimension.
Script used: https://gist.github.com/measureschool/47a5ec08dff86ca117196abf5ce746f4
🎓 Learn more from Measureschool: http://measureschool.com/products
🚀Looking to kick-start your data journey? Hire us: https://measureschool.com/services/
📚 Recommended Measure Books: https://kit.com/Measureschool/recommended-measure-books
📷 Gear we used to produce this video: https://kit.com/Measureschool/measureschool-youtube-gear
In this video, Julius is going to show you how you can track the initial source from where your user came from in Google Analytics. All and more, coming up.
Hey there and welcome back to another video of measureschool.com teaching you the data-driven way of digital marketing. My name is Julian. But today we have a guest and he’s back on the channel again. Julius from Analytics Mania has joined us to show us a new tracking technique. Now, you probably know in Google Analytics, how to view your source data and where your user that came from. Well, that’s oftentimes just half the truth because it’s heavily based on sessions, which means that you really just know where your user that came from last but not initially. If you wanted to track that you would need to explicitly track it in Google Tag Manager, for example. Now today, Julius is going to show us how we can track that information in Google Tag Manager, and then forward this on to Google Analytics. So we have it available as a custom dimension. Now we’ve got lots to cover. So Julius, take it away.
Let’s expand the settings of our variable, click More Settings, then choose Custom Dimensions and enter the custom dimension. And we want to pass to the custom dimension number one, the value of our cookie variable. So click the button right here, and choose the cookie initial traffic source variable. Click Save.
So what happened right here is that our custom HTML tag has fired successfully. Well, at least we think that it fires successfully. Now, let’s check whether it did the job correctly. Let’s go to developer tools, application. And then we see that our initial traffic source has been set and the traffic sources direct and medium is none. So half of the job is completed successfully. Now, let’s go to the tag assistant Chrome extension, click on Google Analytics and see what data was passed over to Google servers. So click here. And we see that there is a tab called custom metrics. So we see that in as a custom dimension number one the value of our cookie was set. Now do not fear, it doesn’t look that nice compared to the value of our variable right here. That’s because the equal sign is encoded right here. But if we check the Google Analytics reports, we will see that this strange code will be actually displayed properly as an equal sign. Let’s take a look at how the initial traffic source looks in Google Analytics reports. So head over to Google Analytics. Here, I have the acquisition reports of source and medium. And with the default GA functionality, you are able to see the last traffic source that was attributed to goals. Of course, if I had some data right here. But thanks to the initial traffic source, you’re also able to see what was the very first traffic acquisition source of those visitors. So you can do that by adding a secondary dimension and the initial, and here it is.
And here’s the data. Ignore the first line I was just playing around with that custom HTML tag. So this is the result. But as you can see, everywhere else, we see not only the last traffic source but the first one as well. So this might give you some new ideas and insights on how traffic sources are contributing to the success of the business. Now, another thing that you need to keep in mind is that this data will not appear in your GA reports right away. It is not available in real time reports, because real-time reports do not display custom dimensions. Also, this data will not appear pretty soon in your regular GA reports. For example, in my case, it takes up to several hours. But usually, I am ready to wait for up to 24 hours. So this is a really important thing to remember. So that’s it. Now we know how to track the initial traffic source of a visitor. This allows you to see the very first source from which the visitor landed on your page.
Now, before you start implementing the solution by yourself, you need to understand the caveats of this solution. First of all, it is based on cookies. So that means that if a user visits your website from another device, or the visitor just simply clears the cookies in the browser, the initial traffic source data will be lost. And when the visitor lands on the page, again, the initial traffic source will get some new value, which will probably be inaccurate. Another caveat is that if you are using cross-domain tracking, and if the visitor navigates from one website that belongs to you to another, there’s a chance that you will see the self-referral data. And unfortunately, this script does not support the referral exclusion list of your Google Analytics settings. That’s why you might see self-referrals in your Google Analytics reports. Additionally, if a person has visited your website some time ago before you implement this initial traffic source tracking solution, there’s a high chance that the value of the initial traffic source parameter will not be accurate, because the script cannot access the historical data of the visitor. However, if you want to go with a more robust solution, you should cooperate with a developer and ask that if the developer would push the initial traffic source data to the data layer. And then you would use that data in your Google Tag Manager container and push that further to Google Analytics or some other third party tools. So that’s it. I hope that you found this video useful. And if you have any questions, just post the question below the video or go to analyticsmania.com and contact me in person.
All right, so there you have it. This is how you can track the initial source of where the user came from in Google Tag Manager first of all, and then forward this on to a custom dimension in Google Analytics. Now, I’d love to hear from you. How would you use that information when once you have it in Google Analytics? If you have already built this in what insights did it give you? Please share with us in the comments down below. Now big thanks to Julius from Analytics Mania. He has a great blog that you should check out at analyticsmania.com. And if you wanted to be on the channel because you want to share a cool tracking technique with us then please reach out to [email protected] and maybe we’ll see you soon enough on this channel. Now, as always, if you like this video, please give us a thumbs up and also subscribe to the channel right over there. Because we bring you new videos just like this one every week. Now, my name is Julian. Til next time