Skip to content

Instantly share code, notes, and snippets.

@harishankerr
Last active September 5, 2016 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harishankerr/956d75fe9c44d4751687021039af170f to your computer and use it in GitHub Desktop.
Save harishankerr/956d75fe9c44d4751687021039af170f to your computer and use it in GitHub Desktop.
<?php // Use only if required.
if ( ! function_exists( 'my_custom_event_function' ) ) {
function my_custom_event_function() {
wc_google_analytics_pro()->get_integration()->custom_event( 'onBannerClick', array(
'hitType' => 'event',
'eventCategory' => 'Outbound Link',
'eventAction' => 'click',
'eventLabel' => 'Shopping-Banner',
'eventValue' => null,
) );
}
add_action( 'wp_head', 'my_custom_event_function' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment