Tagged: google analytics, vimeo
-
AuthorPosts
-
March 22, 2014 at 10:20 am #241560
Hello!
I need to track vimeo playbacks. I have found this https://github.com/sanderheilbron/vimeo.ga.js
To make it work, I need to
1) copy vimeo.ga.min.js to server, I can do that
2) add<script src="path-on-my-site-to/vimeo.ga.min.js"></script>
right after<script src="blahblahblah-jquery"></script>
. Where do I add this code? Is it possible to add the line above into a child theme not to have a mess every time?
3) I need to add ?api=1 at the end of vimeo code. I use avia layout builder, where do I change it?It’s so important to set goals in google analytics, but it’s such a pain in the a.. ))
Thanks for help!
- This topic was modified 10 years, 8 months ago by Vermishelle.
March 25, 2014 at 12:02 am #242408Hey Vermishelle!
To add the script you need to open functions.php go to the line 264 ( assuming you haven’t added anything before ), if not look for this line
wp_enqueue_script( 'jquery' );
You need to add the below code
wp_enqueue_script('vimeo-ga', $template_url . '/js/vimeo.ga.min.js', array('jquery'), 1, true);
This will ask / look for the file in this location ( so paste the file in there ). ENFOLD_FOLDER/js/vimeo.ga.min.jsAbout your other question you can add that to the ending of the url http://vimeo.com/1084537?api=1 , ( if that’s not the case elaborate on that one, or try first and then let us know what happen ).
Best regards,
DavidApril 6, 2014 at 3:02 pm #247908Hi, David!
1) As I see it in page’s code, loading vimeo.ga.min.js works fine
2) And as I see it in page’s code, adding ?api=1 to vimeo address (in video widget) doesn’t translate to “player.vimeo.com/video/90001114?api=1” in page’s code, it’s still just “player.vimeo.com/video/90001114”April 8, 2014 at 6:40 am #248623Hi!
3) Afaik you can’t use the api parameter with the theme video elements. The reason is it’s based on the wordpres embed shortcode: http://codex.wordpress.org/Embeds and this shortcode doesn’t support any parameters at the moment. I.e. if you insert:
[embed width="123" height="456"] http://vimeo.com/1084537?api=1 [/embed]
or
ttp://vimeo.com/1084537?api=1
the wordpress oembed function will strip the parameter and just load:
ttp://vimeo.com/1084537
into
Cheers!
PeterApril 12, 2014 at 8:06 pm #250569I just switched to universal analytics + google tag manager. And that is a completely different story, so let’s close this thread by now.
-
AuthorPosts
- The topic ‘tracking vimeo videos in google analytics’ is closed to new replies.