0

So I have a rescue client running EE 2.10.1 where the client has a number of videos across the site that he wants to track plays. Can anyone provide pointers on how I can achieve this? I'm not very familiar with GA, usually just drop the code into the site and I'm done with it. Here is a quote from my client

On my Vendor Entry Form Page I have a Vendor Tracking Code at the bottom. I then use this code on my Article Pages, Manufacture Pages, Redirect Pages. This allow me to run my GA Report using that code and all the activity show up on one report per client. This is what I use to charge my clients.

On the Vendor Entry Form, I can add Video. However when the video is watched, it doesn't get tracked. No Video is being tracked on my site. I would like to add the vendor code somehow so that when the Video is clicked on and watch, that activity url shows up on my report also.

Looking at the current GA code I see a bit of custom code being sent that looks similar to this: https://developers.google.com/analytics/devguides/collection/analyticsjs/events

specifically:

ga('send', {
  hitType: 'event',
  eventCategory: 'Videos',
  eventAction: 'play',
  eventLabel: 'Fall Campaign'
});

Would I be able to add that into this bit of the GA code and not break anything?

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-*******', 'auto');
  ga('set', 'dimension1', '{exp:stash:client_code}');
  ga('send', 'pageview');

</script>

1 Answer 1

2

You could take a look at Google Tag Manager. I use it to inject GA code into our website pages and for click tracking purposes.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.