gform_hubspot_output_tracking_script

Description

The gform_hubspot_output_tracking_script filter allows the tracking script to be removed.

Note: The tracking script can also be disabled from the UI with the Disable HubSpot Tracking Script setting on the HubSpot add-on settings page. Use this filter instead when the behavior needs to be conditional.

Usage

add_filter( 'gform_hubspot_output_tracking_script', 'your_function_name', 10, 1 );

Parameters

NameTypeDescription
$add_trackingboolWhether to output the tracking script. The default is true.

Examples

Remove the tracking script.

add_filter( 'gform_hubspot_output_tracking_script', '__return_false' );

Placement

This code should be placed in the functions.php file of your active theme.

Since

This filter was added in HubSpot version 1.0.

Source Code

This filter is located in GF_HubSpot::action_wp_footer in class-gf-hubspot.php.