Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save woogists/c8a17479d05d8ca4904b4370529218bd to your computer and use it in GitHub Desktop.
Save woogists/c8a17479d05d8ca4904b4370529218bd to your computer and use it in GitHub Desktop.
[Google Analytics Pro] Tracking custom events snippet example
if ( ! function_exists( 'my_custom_event_function' ) ) {
function my_custom_event_function() {
wc_google_analytics_pro()->get_integration()->custom_event( 'Event name', array( 'Property name' => 'value' ) );
}
add_action( 'hook_to_trigger_event_on', 'custom_event_function' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment