Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #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.
    #242408

    Hey 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.js

    About 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,
    David

    #247908

    Hi, 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”

    #248623

    Hi!

    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!
    Peter

    #250569

    I just switched to universal analytics + google tag manager. And that is a completely different story, so let’s close this thread by now.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘tracking vimeo videos in google analytics’ is closed to new replies.