For developers who need to customize tracking beyond the Add On settings, the Google Analytics Integration Add On offers several filter hooks. Use them to stop tracking in specific cases, support cookie consent tools, and add your own event parameters or user properties.
Filters
pmproga4_dont_track
Determines whether to stop tracking on the current page load. Return true to prevent the Google Analytics tag and all events from loading. Use this to skip tracking for specific users, roles, or pages.
apply_filters( 'pmproga4_dont_track', bool $stop_tracking );
Parameters
$stop_tracking: bool; Whether to stop tracking. Defaultfalse.
pmproga4_script_atts
Filters the attributes added to the inline <script> tag that configures Google Analytics. Use this to add the attributes a cookie consent plugin needs to block or allow the script.
apply_filters( 'pmproga4_script_atts', string $script_atts );
Parameters
$script_atts: string; Attributes for the script tag, such astype="text/plain". Default empty string.
pmproga4_track_view_item_event
Determines whether to send the view_item event on the current page. By default, the event is only sent on the Membership Levels page. Return true to send it on another page, such as a custom pricing page.
apply_filters( 'pmproga4_track_view_item_event', bool $track_view_item_event );
Parameters
$track_view_item_event: bool; Whether to send theview_itemevent. Default istrueon the Membership Levels page andfalseelsewhere.
pmproga4_track_level_ids
Filters the membership level IDs included in the view_item event. Return an empty array to include every level that allows new signups.
apply_filters( 'pmproga4_track_level_ids', array $track_levels );
Parameters
$track_levels: array; Membership level IDs selected in the Levels to Track setting.
pmproga4_default_custom_dimension
Filters the default event parameters the Add On calculates for each page load. Remove a key to stop sending that parameter.
apply_filters( 'pmproga4_default_custom_dimension', array $custom_dimensions );
Parameters
$custom_dimensions: array; Default event parameters as key => value pairs. Default keys arepost_type,author, andcategory.
pmproga4_custom_dimensions
Filters the final event parameters sent to Google Analytics. Use this to add your own parameters or change the default values.
apply_filters( 'pmproga4_custom_dimensions', array $gtag_config_custom_dimensions );
Parameters
$gtag_config_custom_dimensions: array; Event parameters for the current page as key => value pairs.
pmproga4_default_user_properties
Filters the default user properties the Add On calculates for the current user. Remove a key to stop sending that property.
apply_filters( 'pmproga4_default_user_properties', array $user_properties );
Parameters
$user_properties: array; Default user properties as key => value pairs. The default key ismembership_level.
pmproga4_user_properties
Filters the final user properties sent to Google Analytics. Use this to add your own properties, such as a non-identifying User Field value.
apply_filters( 'pmproga4_user_properties', array $gtag_config_user_properties );
Parameters
$gtag_config_user_properties: array; User properties for the current user as key => value pairs.
Remember to create a matching custom dimension in GA4 for any event parameter or user property you add.
Get Support From Our Team of Experts
Have a question about how to use this feature? Our Support Page outlines three ways to get support.
Our Max plans include hands-on help customizing your membership site and implementing new features. Upgrade to PMPro Max now »
Last updated on November 6, 2026

