Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created July 30, 2013 21:27
Show Gist options
  • Select an option

  • Save joshfeck/6117153 to your computer and use it in GitHub Desktop.

Select an option

Save joshfeck/6117153 to your computer and use it in GitHub Desktop.
A few functions that will allow you to insert tracking code into the head of the document on the single registration page. You can substitute the hook if you want the tracking code to go on another page. Requires WordPress + Event Espresso 3.x Support forum post: http://eventespresso.com/topic/is-there-a-way-to-insert-tracking-codes-in-within-th…
<?php
add_action ( 'action_hook_espresso_social_display_buttons', 'itc_add_tracking_code_hook');
add_action ( 'wp_head', 'itc_print_tracking_code' );
function itc_add_tracking_code_hook () {
global $add_my_tracking_code;
$add_my_tracking_code = true;
}
function itc_print_tracking_code () {
global $add_my_tracking_code;
if ( ! $add_my_tracking_code )
return;
?>
<script type="text/javascript">
// your tracking code goes here
</script>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment