Skip to content

Instantly share code, notes, and snippets.

@JudeRosario
Created February 5, 2015 15:25
Show Gist options
  • Save JudeRosario/491022202c18907154cf to your computer and use it in GitHub Desktop.
Save JudeRosario/491022202c18907154cf to your computer and use it in GitHub Desktop.
Appointments+ and Google Analytics Integration
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