Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2013
    Posts
    15
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Google Analytics Event Tracking in Fancybox Lightbox

    Hi

    I want to track image views in fancybox with google analytics event tracking so that any loading of a particular image gets tracked.
    But it doesnt work?

    I tried:

    Code:
    jQuery(document).ready(function(){
        jQuery('a[rel=screenshots]').fancybox({
            'type':'image',
            'transitionIn':'fade',
            'transitionOut':'fade',
            'onComplete':function(){_gaq.push(['_trackEvent','ComicBox','Screenshots', this.title]);}
        });
    });
    Code:
    <a href="screenshots/screenshot_2.png" rel="screenshots" title="Screenshot 2" target="_blank">Screenshot 2</a>
    from here


    but it does not work.

    I checked this with firebug event tracking check and I dont get another _utm.gif

    Did anybody get this done?

  • #2
    New Coder
    Join Date
    Mar 2013
    Posts
    15
    Thanks
    4
    Thanked 0 Times in 0 Posts
    With:

    Code:
    <a class="fancybox"   rel="p1" href="http://www.name.jpg" title="name" onClick="_gaq.push(['_trackEvent', 'post', 'imgclick']);">Open1</a>
    
    <a class="fancybox"   rel="p2" href="http://www.name.jpg" title="name" onClick="_gaq.push(['_trackEvent', 'post', 'imgclick']);">Open2</a>

    Both events get tracked independently as these are two seperate lightboxes.

    But combined in 1 lightbox only the entrance image click gets tracked. Navigation to the next images doesnt get tracked anymore.


    How can you get every image view within one lightbox tracked, please?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •