GA Pro is equipped with the following action and filter hooks. These are useful for developers to customize functionality and add features.
Action Hooks
Action | Description |
---|---|
No action hooks yet! | Feel free to suggest one » |
Filter Hooks
Filter | Description |
---|---|
gapro_default_options |
Filters the array of default options for plugin settings |
gapro_locale |
Filters the locale (for translations, etc.) |
gapro_login_hook |
Filters which WP hook to use to output the GA tracking code on the WP Login Page (default: login_head ) |
gapro_custom_code_1 , gapro_custom_code_2 , gapro_custom_code_3 |
Filters the output for Custom Code 1, 2, and 3 |
gapro_custom_filter |
Filters Custom Code for Primary Tracking |
ga_google_analytics_enable_auto |
Filters true or false for inclusion of the auto parameter in ga('create', 'TRACKING_ID', 'auto'); when using Universal Analytics tracking method |
ga_google_analytics_options_array |
Filters the options array used by the various tracking functions |
ga_google_analytics_pro_optout_title_info |
Filters title attribute text for the Opt-Out Box when using the [ga_pro_optout] shortcode (default: “Click for more information”) |
ga_google_analytics_pro_optout_title_hide |
Filters title attribute text for the Opt-Out Box when using the [ga_pro_optout] shortcode (default: “Click to close this notice”) |
ga_google_analytics_pro_optout_output |
Filters the final output/markup for the [ga_pro_optout] shortcode |
ga_google_analytics_pro_optout_message , ga_google_analytics_pro_filter_message |
Filters the opt-out message (default: value of the optout_message setting) |
ga_google_analytics_pro_optout_title |
Filters the default title attribute text for the [ga_pro_optout_link] shortcode (default: “Click here to opt out of Google Analytics”) |
ga_google_analytics_pro_optout_link |
Filters the final output/markup for the [ga_pro_optout_link] shortcode |
ga_google_analytics_pro_optin_title |
Filters the default title attribute text for the [ga_pro_optin_link] shortcode (default: “Continue using Google Analytics”) |
ga_google_analytics_pro_optin_link |
Filters the final output/markup for the [ga_pro_optin_link] shortcode |
ga_google_analytics_pro_optin_plain_title |
Filters the default title attribute text for the [gapro_optin_plain] shortcode (default: “Continue using Google Analytics”) |
ga_google_analytics_pro_optin_plain |
Filters the final output/markup for the [gapro_optin_plain] shortcode |
ga_google_analytics_pro_optout_plain_title |
Filters the default title attribute text for the [gapro_optout_plain] shortcode (default: “Click here to opt out”) |
ga_google_analytics_pro_optout_plain |
Filters the final output/markup for the [gapro_optout_plain] and [gapro_optout_toggle] shortcodes |
gapro_script_atts |
Filters the <script> tags for GA tracking code blocks |
gapro_script_atts_ext |
Filters the <script> tag for the gtag external script |
gapro_tracker_object_universal |
Filters the tracker object for Universal tracking |
gapro_tracker_object_global |
Filters the tracker object for Global tracking |
ga_google_analytics_pro_disable_custom |
Enables disable of all tracking codes programmatically |
I will be adding more hooks in future versions on an as-needed basis, so let me know if you have any requests and it shall be done :)