$(document).ready(function() { // Event Tracking // Ad Unit on My Guy page // // $('.myGuyAdUnit1').click(function() { _gaq.push(['_trackEvent', 'Ad Links', 'Clicked', 'MyGuy Homepage Unit']); }); // Which homepage link is most used // // $('#logowrap').click(function() { _gaq.push(['_trackEvent', 'Go Home', 'Clicked', 'Logo Link']); }); $('#menu-item-2561').click(function() { _gaq.push(['_trackEvent', 'Go Home', 'Clicked', 'Footer Menu Link']); }); // Which Support Link is clicked $('#menu-item-4834').click(function() { _gaq.push(['_trackEvent', 'Support', 'Clicked', 'Header Menu Link']); }); $('#menu-item-2421').click(function() { _gaq.push(['_trackEvent', 'Support', 'Clicked', 'Footer Menu Link']); }); // Homepage activities // This is conditional - we only want to trigger it if we're on the home page // if ($('#homepage').length) { // Getting specific stats on the nav menu link clicking for DIRECTV $('#menu-item-2426').click(function() { _gaq.push(['_trackEvent', 'Homepage DIRECTV', 'Clicked', 'Nav Menu Link']); }); $('.slider-link').click(function() { var url = $(this).attr('href'); var theID = $(this).attr('id'); _gaq.push(['_trackEvent', 'Slider', 'Clicked', 'pos:' + url + ' href: ' + theID]); }); $('.ituneDownload').click(function() { _gaq.push(['_trackEvent', 'Download Link', 'Clicked', 'iTunes from Homepage']); }); $('.googleDownload').click(function() { _gaq.push(['_trackEvent', 'Download Link', 'Clicked', 'Google Play from Homepage']); }); } // Which DIRECTV link is clicked on MyGuy page // // This is conditional - we only want to trigger this a) if we're on the MyGuy page // and if the internal promo is the DIRECTV promo // if ($('#myguy').length) { var $internalPromo = $('#first-promo img').attr('alt'); if ($internalPromo == "Viggle and DIRECTV") { $('#menu-item-2426').click(function() { _gaq.push(['_trackEvent', 'MyGuy DIRECTV', 'Clicked', 'Nav Menu Link']); }); $('#first-promo').click(function() { _gaq.push(['_trackEvent', 'MyGuy DIRECTV', 'Clicked', 'MyGuy Internal Promo Link']); }); } } // Number of clicks on app download links from internal pages // // if ($('#homepage').length == 0) { $('.ituneDownload').click(function() { var page = $(location).attr('href'); _gaq.push(['_trackEvent', 'Download Link', 'Clicked', 'iTunes from ' + page]); }); $('.googleDownload').click(function() { var page = $(location).attr('href'); _gaq.push(['_trackEvent', 'Download Link', 'Clicked', 'Google Play from ' + page]); }); } // Number of clicks out to social media sites // // $('#facebook-social-footer').click(function() { var page = $(location).attr('href'); _gaq.push(['_trackEvent', 'Social Media', 'Clicked', 'Facebook from ' + page]); }); $('#twitter-social-footer').click(function() { var page = $(location).attr('href'); _gaq.push(['_trackEvent', 'Social Media', 'Clicked', 'Twitter from ' + page]); }); // How interested are people in the Twitter hashtag? // // $('.viggleHashtag').click(function() { twitterType = $(this).attr('id'); _gaq.push(['_trackEvent', 'Twitter Interaction', 'Clicked', twitterType]); }); // How do people interact with the shows page if ($('#shows').length) { $('.griditem').click(function() { var show = $(this).find('img').attr('alt'); var gridPos = $(this).attr('id'); _gaq.push(['_trackEvent', 'Show Page Grid Item', 'Clicked', show + ' in ' + gridPos]); }); $('#learnmore').click(function() { var show = $(this).parent('#show-meta').find('#show-title').html(); _gaq.push(['_trackEvent', 'Learn More About Show', 'Clicked', show]); }); } // How do people interact with the rewards page if ($('#rewards').length) { $('.griditem').click(function() { var show = $(this).find('img').attr('alt'); var gridPos = $(this).attr('id'); _gaq.push(['_trackEvent', 'Rewards Page Grid Item', 'Clicked']); }); } });