Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #429869

    I’d like to track clicking lightbox videos (images with vimeo links) and images views with google tag manager, so I need to insert a bit of code every time lightbox opens, and to have access to lightbox url target as a parameter.

    Is there some add_filter(blah-blah) for that, not to mess with main theme’s code?

    • This topic was modified 9 years, 8 months ago by Vermishelle.
    #429875

    BTW, every time I send a message to this forum, I have a blank screen after pressing “submit”. For a couple of few weeks now. Me only?

    #431274

    Hi!

    Sorry for the late reply!
    Can you please post here the code you would like to add using http://pastebin.com/?
    If you need to place the code inside Body tag, you can add following code to Functions.php file in Appearance > Editor

    function add_custom_tooltip(){
    ?>
    
    YOUR CODE GOES HERE INCLUDING SCRIPT TAGS
    
    <?php
    }
    add_action('wp_footer', 'add_custom_tooltip');

    Thanks for the report. Few other users reported the issue but have not been able to reproduce it yet, but we are looking into it :)

    Regards,
    Yigit

    #431283

    I managed to track vimeo lightbox runs in google tag manager, here’s what’s left to do: on every lightbox photo view I’d like to run this line of code:

    dataLayer.push({'event': 'button1-click'});

    or, as you asked
    http://pastebin.com/gQpif6hY

    I need this code to run every time a new lightbox picture opens, including clicks on side arrows when a visitor thumbs through a gallery.
    So, I’ll be able to count how many pictures a visitor has seen in lightbox, using google tag manager and google analytics.

    • This reply was modified 9 years, 8 months ago by Vermishelle.
    #431919

    Hi,

    Try adding that code to line 935 in js/avia.js, inside the open callback of the lightbox activation.

    Best regards,
    Josue

    #431972

    I tried before line 935, I tried after line 935, neither it didn’t work.

    For simplicity, let’s test with this code of google analytics:
    ga('send', 'event', 'test', 'test');

    No test event happens in realtime events view window…

    #432295

    Hm, if you put something like

    console.log('some');
    

    Do you see anything in the console when opening a lightbox?

    Regards,
    Josue

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.