AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

2K members online now
2K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
Guide Me

GA For Fancybox

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I have implemented Fancybox (a lightbox plugin) onto a landing page on our website.  Fancybox opens to play a Vimeo video when a button is clicked.  I am trying to get GA event code to fire when the box opens to record how many people clicked the button.  For some reason though, nothing is recording to our analytics account.  I am hoping someone might be able to shed some light on this.  Google Analytics code is on the page and running.  I have verified this with Tag Assistant.


Here is my fancybox code with the Google event tracking code:


<script type="text/javascript"> 
$(document).ready(function() { 
'padding': 0, //optional 
'width': 800, //or whatever 
'height': 450, //or whatever 
'type': 'iframe',
afterLoad: function() {
 ga('send', 'pageview', this.href);
 ga('send', 'event', 'Video', 'play', '189234917.hd.mp4');
}); //ready 

and here is my button code:

<div class="button">
              <a class="vimeo" href="">Watch the two minute video &raquo;</a>


1 Expert replyverified_user

GA For Fancybox

Top Contributor
# 2
Top Contributor

Hi what's the URL to your site?


VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan

GA For Fancybox

Explorer ✭ ✭ ✭
# 3
Explorer ✭ ✭ ✭

Hi Justin,


I am guessing that fancy box is present as Iframe on your site.
Iframes are independent of any code present on site that include google analytics tracking code.
In order to track conversion you will need to put google analytics code within the iframe. Also make sure to setup cross domain tracking by embedding client id in iframe src.


hit like if this help Smiley Happy

kind regards 

Noman Karim

follow us on Twitter


GA For Fancybox

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Hi Julien,


The URL is