Created
February 5, 2015 15:25
-
-
Save JudeRosario/491022202c18907154cf to your computer and use it in GitHub Desktop.
Appointments+ and Google Analytics Integration
This file contains hidden or 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
function GA_Event_Code($ret) { | |
$script = <<< GACode | |
<script type="text/javascript"> | |
jQuery(document).ready(function($) { | |
jQuery( ".appointments-confirmation-button" ).bind( "click", function() { | |
// Update variable names here to match what you previously set. | |
_gaq.push(['_trackEvent', 'Confirmed', 'Click', 'Appointment Confirmed']); | |
}); | |
}); | |
</script> | |
GACode; | |
return $script.$ret ; | |
} | |
// Hook early so that we bind before the redirect | |
add_filter ('app_schedule_before_table','GA_Event_Code') ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment