This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//NOTE: you must also include https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js | |
var tag = document.createElement('script'); | |
tag.src = "https://www.youtube.com/player_api?enablejsapi=1&version=3&showinfo=0"; | |
var firstScriptTag = document.getElementsByTagName('script')[0]; | |
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); | |
var player; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTE: this assumes you have loaded jQuery | |
$(document).ready(function() { | |
// REPLACE 'UNIQUE_FORM_ID' BELOW WITH THE ID OF YOUR FORM | |
$('#UNIQUE_FORM_ID input').blur(function () { | |
if($(this).val().length > 0) { | |
_gaq.push(['_trackEvent', 'Form: FORM NAME HERE','input_exit_full', $(this).attr('name')]); | |
} | |
else { | |
_gaq.push(['_trackEvent', 'Form: FORM NAME HERE','input_exit_empty', $(this).attr('name')]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This assumes that you have included the Tweet button via the standard Twitter JS include | |
// Thanks to Google for most of this code, see the Social Interaction Analytics guide at | |
// https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSocial | |
// To track a Tweet, subscribe to the tweet event (note the additional function required | |
// to determine the query parameter being sent to Twitter): | |
function trackTwitter(intent_event) { | |
if (intent_event) { | |
var opt_pagePath; | |
if (intent_event.target && intent_event.target.nodeName == 'IFRAME') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This assumes Facebook buttons are using the Facebook Javascript SDK. | |
// Thanks to Google for most of this code, see the Social Interaction Analytics guide at | |
// https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSocial | |
// Facebook provides a Javascript event framework that allows you to subscribe to events | |
// happening within the Facebook Javascript SDK and provides data accordingly. | |
// To track a like, subscribe to the edge.create event and then use the callback to | |
// execute the Analytics tracking code: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTE: this assumes you have loaded jQuery | |
$(document).ready(function() { | |
// REPLACE 'UNIQUE_FORM_ID' BELOW WITH THE ID OF YOUR FORM | |
$('#UNIQUE_FORM_ID input').blur(function () { | |
if($(this).val().length > 0) { | |
_gaq.push(['_trackEvent', 'Form: FORM NAME HERE','input_exit_full', $(this).attr('name')]); | |
} | |
else { | |
_gaq.push(['_trackEvent', 'Form: FORM NAME HERE','input_exit_empty', $(this).attr('name')]); |