Sign inDocsBlogAboutSupportContact
Analytics

Install Pinterest Tag on WordPress

Tag ID in hand, one command installs Pinterest tracking. Base code fires on every page, ready for event-specific tags in Pinterest Ads Manager.

3 min read May 2026 enable pinterest tag

The WordPress way to install Pinterest Tag is clunky

Your visually-driven brand gets traffic from Pinterest. Without the Pinterest Tag, you can't measure conversions from Pinterest Ads or build retargeting audiences.

The canonical WordPress paths are: install an analytics plugin (comes with admin pages, updates, subscription nags), paste the snippet into functions.php (breaks when you switch themes), or set up Google Tag Manager as middleware (overkill for one pixel).

What most people do instead

Install a dedicated Pinterest Tag pluginYet another plugin. Admin page, settings, update nag. Some have premium tiers to unlock basic features.
Paste the tracking code into functions.phpTied to the active theme. Switch themes → tracking disappears. No conditional logic.
Set up GTM as middlewareAdds another layer. GTM itself has to be installed. Overkill if Pinterest Tag is the only thing you need.

How to add the Pinterest Tag to WordPress without a plugin

You can drop the base tag code in by hand. A must-use plugin that prints it on the wp_head hook does the job:

// wp-content/mu-plugins/pinterest-tag.php
add_action( 'wp_head', function () { ?>
  <!-- Pinterest Tag: paste your base code from Pinterest Ads, under Conversions then Tag manager -->
  <script>
    /* paste Pinterest's base tag loader (defines pintrk) here */
    pintrk('load', 'YOUR_TAG_ID');
    pintrk('page');
  </script>
<?php } );

Swap in your Tag ID and it starts firing on every page. The trade-offs are the usual ones:

  • A theme switch drops a functions.php version, so use mu-plugins to avoid that.
  • The ID lives in a file, with no interface to change it.
  • It fires for logged-in admins too, which skews your data.
  • No consent gating, which is a GDPR concern in many regions.

The command does the same thing in one step, with a consent-aware option, and no file to babysit.

A better way: one command, one ID, tracking live

Run enable pinterest tag with your Tag ID. The command auto-registers as a startup command so the tracking snippet outputs on every page load. No theme edit, no plugin, no GTM middleware.

TrueCommander
Pinterest Tag enabled
Tracking live on next page load
Tag ID: 2612345678901
Registered as startup commandactive
Consent-aware: optional flagGDPR-friendly

Shown in advanced mode, where commands start with tp. In easy mode you type the same command without the tp prefix.

Consent-aware flag included. Pass -consent_aware=true and the pixel only fires when your cookie-consent plugin's gate has been accepted. Works with any standard WP consent plugin that sets a cookie flag.

How it works

The command hooks wp_head with the Pinterest-provided tracking snippet, then auto-registers itself in Startup Commands so the tracking stays active across requests. Re-running with a different ID updates the existing entry. Disable from Startup Commands to remove.

1
Get your Tag IDPinterest Ads Manager → Conversions
2
Run the command with the IDtp enable pinterest tag -pid=2612345678901
3
Verify in Pinterest's dashboardPinterest Tag shows tracking events within minutes
ParameterValue
-pid (required)Tag ID (format: 2612345678901)
-consent_awaretrue to only fire after cookie consent (checks standard consent cookie)
ScopeAuto-registered as startup command, runs on every frontend page load
Where to find the IDPinterest Ads Manager → Conversions
Can be used in

Real example

Your home decor brand gets 30% of traffic from Pinterest organic. You want to start running Pinterest Ads to amplify, but need the tag installed first. Run tp enable pinterest tag -pid=2612345678, launch the campaign, and conversions report back within a day.

Goes further with TrueCommander

Frequently asked questions

Ready?

Pinterest Tag tracking in 30 seconds.

This is one of 91 commands. All included with every license.

Cookies. The short version.

Essential cookies keep the cart and theme working. Analytics only fire if you say yes. Read our policy.