The WordPress way to install Snap Pixel is clunky
You're running Snap Ads. Without the Snap Pixel, your campaign optimizes blind and you can't build 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
A better way: one command, one ID, tracking live
Run enable snapchat tag with your Pixel 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.
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 Snap Inc.-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.
enable snapchat tag -pid=12345678-1234-1234-1234-123456789abc| Parameter | Value |
|---|---|
-pid(required) | Pixel ID (format: 12345678-1234-1234-1234-123456789abc) |
-consent_aware | true to only fire after cookie consent (checks standard consent cookie) |
| Scope | Auto-registered as startup command — runs on every frontend page load |
| Where to find the ID | Snap Ads Manager → Events Manager |
| Can be used in |
Real example
You're a Gen Z apparel brand running Snap Ads. The ads drive traffic but you don't know conversion rate by creative. Run enable snapchat tag -pid=12345678-1234-1234, configure a "purchase" event in Snap, and the ads platform starts optimizing toward actual buyers.