Created
March 9, 2018 15:00
-
-
Save woogists/c8a17479d05d8ca4904b4370529218bd to your computer and use it in GitHub Desktop.
[Google Analytics Pro] Tracking custom events snippet example
This file contains 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
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