: Get the conversion's first touch source in Google Analytics Universal I think this solution is not possible when using Google Analytics Universal - I am right? https://www.distilled.net/blog/seo/first-touch-tracking-in-google-anal
I think this solution is not possible when using Google Analytics Universal - I am right?
www.distilled.net/blog/seo/first-touch-tracking-in-google-analytics/
Are there other ways to get the first touch source of a conversion?
More posts by @Murphy175
1 Comments
Sorted by latest first Latest Oldest Best
The script would work with some tweaking, the only change would be setting 'custom dimensions' instead of variables.
However, a more elegant solution would be this tag manager implementation which lets you filter by session to view a single users funnel.
Not great for big data but lets you pull case studies.
Edit: I went ahead and tested the Tag Manager method:
Create a custom HTML tag, insert this script:
<script>
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for(var i=0; i<ca.length; i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1);
if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
}
return "";
}
if (!getCookie("firstTouch"))
{document.cookie = "firstTouch=" + window.location.pathname;}
</script>
Add cookie variable
Create a custom dimension in Analytics
You can send the custom dimension in all your pageviews (optimal), or to test it you can put the variable into an event label. This will appear in 'Real Time' events then for you to check immediately:
If you wanted a pure javascript version, then you can edit your push to include firstTouch in the custom dimension like this:
> <script> function getCookie(cname) {
> var name = cname + "=";
> var ca = document.cookie.split(';');
> for(var i=0; i<ca.length; i++) {
> var c = ca[i];
> while (c.charAt(0)==' ') c = c.substring(1);
> if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
> }
> return ""; } if (getCookie("firstTouch"))
> {var firstTouch = getCookie("firstTouch"));}
> else {document.cookie = "firstTouch=" +
> window.location.pathname;} ga('set', 'dimension1', firstTouch);
> </script>
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.