October 27, 2014 at 9:32 pm #341800
Hi, I have a video on my home that I want to track with Google Analytics event tracking. I found this useful post how to add event tracking to the image element:
My application however is the video player which I don’t believe has the same on_click_event. Either way I tried it and it doesn’t seem to work.
I tried these steps:
1. Add custom CSS class to video selector called ‘ga-track’
2. Added this code the functions.php:
// theme support appears to be added by default see script below
jQuery(“.ga-track a”).attr(“onclick”,”_gaq.push([‘_trackEvent’, ‘Videos’, ‘Play’, ‘My Video’]”);
In Analytics I did this:
Basically nothing happens.October 28, 2014 at 5:30 am #342000
Thank you for using Enfold.
What type of video are you trying to use? If you search on google, you will find this:
IsmaelMarch 18, 2015 at 10:02 pm #414006
Im using Google Tag Manager and are able to to track youtube videos so far know that there are solutions out there for html5 and vimeo also.
//Cheers!March 19, 2015 at 3:21 pm #414485March 20, 2015 at 3:33 am #414993
To be more on the point and solve the problem I got and ide how too.
There are many how to´s on the net for the setup for Google Tag Manger and event for Google Analytics to track stuff.
Here is a guide how to setup for ytvideos its only 90% working u have to add some code on yt links.
I have a 99% working tracking for ytvideos so you dont have do add anything ist just works :-) I can help you it takes like 15 min.
“Google is always changing so that wasy 99%”
Step 1 is optional but good to do.
Create a child theme if you dont know how to here is a link (see below)
If you have input in the Quick CSS area copy that to an notepad so u dont loose it.
Activate Child theme.
Add back the CSS code to the Quick CSS area.
Use FTP and download the header.php from the Enfold directory
Edit the header.php and insert the Google Tag Manager Code just after this line.
body id="top" <?php body_class($style." ".$avia_config['font_stack']." ".$blank); avia_markup_helper(array('context' => 'body')); ?>>
Maby soon there will be a box to input this code in the theme admin area but for now i use ftp.
Upload this file to your Enfold Child theme.
Send me an email and i can help you with the tracking I will need to acces GTM container with full admin to copy over my settings here. If u want me to add a goal for this in Google Analytics you need to invite me here also. After im done you can remove me and then happy tracking on your youtube views :-)
My email : (Email address hidden if logged out)
March 21, 2015 at 5:21 am #415633
- This reply was modified 6 years, 10 months ago by apower84.
You must be logged in to reply to this topic.