-
AuthorPosts
-
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:
https://kriesi.at/support/topic/how-to-add-google-analytics-event-tracking-code-to-image-links-and-text-links/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
// add_theme_support(‘avia_template_builder_custom_css’);function add_custom_script(){
?>
<script>
jQuery(window).load(function(){
jQuery(“.ga-track a”).attr(“onclick”,”_gaq.push([‘_trackEvent’, ‘Videos’, ‘Play’, ‘My Video’]”);
});
</script>
<?php
}
add_action(‘wp_footer’, ‘add_custom_script’);In Analytics I did this:
https://docs.google.com/a/snowball.co.za/file/d/0B10etxh2shi0UWI4X3Vkd1h3eGs/edit?usp=drivesdkand this:
https://docs.google.com/a/snowball.co.za/file/d/0B10etxh2shi0QkNjenlJN1NoOEE/edit?usp=drivesdkBasically nothing happens.
October 28, 2014 at 5:30 am #342000Hey eugenesnowball!
Thank you for using Enfold.
What type of video are you trying to use? If you search on google, you will find this:
http://stackoverflow.com/questions/13632561/video-tracking-using-ga-event-tracking
http://gaconfig.com/google-analytics-event-tracking/video/Best regards,
IsmaelMarch 18, 2015 at 10:02 pm #414006@Hi eugenesnowball,
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 #414993Hi @eugenesnowball and @Ismael
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.
http://www.cardinalpath.com/youtube-video-tracking-with-gtm-and-ua-a-step-by-step-guide/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.
http://kriesi.at/documentation/enfold/using-a-child-theme/Step 2
Activate Child theme.
Add back the CSS code to the Quick CSS area.Step 3.
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.Step 4.
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)
- This reply was modified 9 years, 8 months ago by apower84.
March 21, 2015 at 5:21 am #415633 -
AuthorPosts
- You must be logged in to reply to this topic.