Tagsmith icon
Analytics & Tracking

Tagsmith hooks reference

Tagsmith 2.5.0 has 3 actions and 20 filters, read directly from its source code on Nov 19, 2026. The list updates automatically when a new version is released.

How to use these hooks

Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.

functions.phpyour child theme
// Run your own code when Tagsmith fires an action
add_action( 'tagsmith_cache_cleared', function() {
	// Your code runs here.
}, 10, 1 );

// Change a value Tagsmith is about to use
add_filter( 'tagsmith_clarity_tags', function( $tags ) {
	// Change $tags here.
	return $tags;
}, 10, 1 );

Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.

All hooks

  • src/Auth/OAuthFlow.php line 651 · used in 2 places
    /**
     * Fires the same action ReportRunner::clear_cache() fires, so a reconnect
     * resets state that depends on the report cache (e.g. PostsColumn's warm-up
     * cooldown) even though OAuthFlow cannot depend on ReportRunner directly:
     * ReportRunner is built from DataApi/SearchConsoleApi, which are themselves
     * built from this OAuthFlow, so injecting it here would be circular.
     */
    do_action( 'tagsmith_cache_cleared' );
  • src/Tracking/TagRenderer.php line 633
    /**
     * Filters the WordPress context tags Tagsmith sends to Microsoft Clarity with
     * clarity('set', key, value).
     */
    apply_filters( 'tagsmith_clarity_tags', $tags );
  • src/Tracking/TagRenderer.php line 417
    /**
     * Filters the fields Tagsmith adds to the gtag('config', ...) call, for
     * example send_page_view or a cookie_domain. Printed as JSON. On a page whose
     * address carries a WooCommerce order key, Tagsmith sets `page_location` (the
     * address without the key) after this filter (since 2.3.0).
     */
    apply_filters( 'tagsmith_gtag_config', array() );
  • src/Health/HealthCheck.php line 319
    /**
     * Filters the result of each check on the Settings, Health tab.
     */
    apply_filters( 'tagsmith_health_check_result', $result, $result['id'] );
  • src/Plugin.php line 444
    /**
     * Fires once the plugin has booted, on plugins_loaded. Add-ons hook here to
     * read settings or register their own services through the Plugin getters.
     */
    do_action( 'tagsmith_loaded', $this );
  • src/Plugin.php line 1032
    /**
     * Filters the domain the Connect step names for Google's unverified-app
     * screen. With your own relay, return your OAuth app's home domain here (a
     * host name, without a scheme, a path or a port). When nothing valid is
     * returned, the note is not shown.
     */
    apply_filters( 'tagsmith_oauth_app_domain', '' );
  • src/Pixels/PixelRenderer.php line 707
    /**
     * Filters the vendor event names of the ad platforms that let you choose:
     * Pinterest's `contact` (it only builds audiences, so advertisers who want
     * contact conversions can send `lead`), and Snap's `lead` (sent as SIGN_UP,
     * because Snap has no lead event; CUSTOM_EVENT_1 to CUSTOM_EVENT_5 are the
     * other choice).
     */
    apply_filters( 'tagsmith_pixel_vendor_events', $names );
  • src/Pixels/PixelRenderer.php line 475
    /**
     * Filters the ad pixels config printed as `window.tagsmithPixels`.
     */
    apply_filters( 'tagsmith_pixels_config', $config );
  • src/Reports/PostPaths.php line 63
    /**
     * Filters the GA4 page paths counted as one post.
     */
    apply_filters( 'tagsmith_post_paths', $paths, $post );
  • src/Plugin.php line 999
    /**
     * Filters the URL of the relay that handles the Google sign-in. Not applied
     * when the TAGSMITH_RELAY_URL constant is defined.
     */
    apply_filters( 'tagsmith_relay_url', self::DEFAULT_RELAY_URL );
  • src/Reports/ReportRegistry.php line 74
    /**
     * Filters the report definitions (id => definition). See Reports\Definitions
     * for the shape.
     */
    apply_filters( 'tagsmith_report_definitions', Definitions::all() );
  • src/Rest/Routes.php line 74
    /**
     * Fires after the tagsmith/v1 routes are registered, on rest_api_init. Add-ons
     * register their own routes here.
     */
    do_action( 'tagsmith_rest_init', $this->plugin );
  • src/Tracking/Gate.php line 120
    /**
     * Filters whether a visit is tracked, after Tagsmith's own checks
     * (environment, request type and excluded roles) have passed. Return false to
     * leave this visit out, for example for a page or a visitor your site treats
     * as internal.
     */
    apply_filters( 'tagsmith_should_track', true, $user );
  • src/Store/PurchasePage.php line 149
    /**
     * Filters the WooCommerce order shown on this page, for a custom thank-you
     * page that is neither WooCommerce's nor a funnel plugin's. Return an order ID
     * only after your page has checked that this visitor may see the order
     * (WooCommerce's order key, or the logged-in customer): Tagsmith treats it
     * like WooCommerce's own thank-you page.
     */
    apply_filters( 'tagsmith_store_order_received', null );
  • src/Store/Endpoint.php line 199
    /**
     * Filters the order statuses for which Tagsmith sends a WooCommerce sale. A
     * `pending` order is never sent: the browser waits for it to be paid.
     * `failed`, `cancelled` and `refunded` are never sent either.
     */
    apply_filters( 'tagsmith_store_paid_statuses', self::PAID_STATUSES );
  • src/Store/Endpoint.php line 339
    /**
     * Filters a WooCommerce purchase before Tagsmith records and sends it. You can
     * only narrow it: return anything but an array to send nothing (the order is
     * recorded as filtered); remove `tax`, `shipping`, an item (unset its key) or
     * an item's field. Values you change and fields you add are ignored.
     */
    apply_filters( 'tagsmith_store_purchase', $built, $id );
  • src/Store/Steps.php line 453
    /**
     * Filters a shopping step before it is queued or sent. Return false to drop
     * it.
     */
    apply_filters( 'tagsmith_store_step', $params, $name );
  • src/Diagnosis/TagProbe.php line 312
    /**
     * Filters the pages the Traffic check loads to look for the Google tag: label
     * => URL. Only http and https URLs on this site's own host are kept, at most
     * four.
     */
    apply_filters( 'tagsmith_traffic_check_pages', $urls );
  • src/Diagnosis/TrafficCheck.php line 820
    /**
     * Filters the Traffic check result before it is returned or stored.
     */
    apply_filters( 'tagsmith_traffic_check_result', $result, $range );
  • src/Health/PageFetch.php line 73
    apply_filters( 'https_local_ssl_verify', false );
  • src/Store/Check/CountedStatuses.php line 58
    apply_filters( 'woocommerce_analytics_excluded_order_statuses', $list );
  • src/Store/Check/CountedStatuses.php line 53
    apply_filters( 'woocommerce_analytics_settings_default_excluded_order_statuses', self::DEFAULT_EXCLUDED );
  • src/Store/WcOrders.php line 84
    apply_filters( 'woocommerce_order_email_verification_grace_period', self::GRACE, $order, 'order-received' );

Generated from Tagsmith's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.

Done for you

Rather have it built for you?

Tell us what should change and we’ll write and test the code using these hooks.

Plugin customisation

from $149

New features or changed behaviour, without editing the plugin’s files.

  • Built as a companion plugin, so updates never wipe it
  • Exact quote before we start
  • Tested on staging, then deployed

Typical turnaround: 3–7 business days

Choose this

Not sure which fits? Describe what you need and we’ll suggest the simplest option.

Can't find the right hook?

We can build the customisation for you. Describe what you need: