Pinterest Conversion API Tag for Google Tag Manager Server-Side

The Pinterest Conversion API Tag for Google Tag Manager Server-Side allows you to send site events and parameters directly to Pinterest servers using the Pinterest Conversion API (v5). It works with GA4 or the custom Data Client inside the GTM Server-Side container.

The tag supports standard and custom events, event deduplication, real-time server event testing, and automatic SHA-256 hashing of user data.

How to use the Pinterest Conversion API Tag

  1. Add the Pinterest Conversion API Tag to your server container in GTM.
  2. Choose your Event Name Setup Method: select a standard event, set a custom event name, or choose “Inherit from client” to automatically map GA4 events to Pinterest standard events.
  3. Enter your Pinterest Advertiser ID and API Access Token.
  4. Configure the Server Event Data Override, User Data, and Custom Data parameters as needed.
  5. Add a trigger to fire the tag (e.g., on a custom event or a GA4 client claim).

Event Name Setup

You can configure how events are sent in three ways:

  • Standard: Manually select one of the supported Pinterest event names from a dropdown list.
  • Inherit from client: The tag automatically maps common GA4 event names to their Pinterest equivalents (e.g., page_view → page_visit, purchase → checkout, add_to_cart → add_to_cart). If an event cannot be mapped, it defaults to custom.
  • Custom: Set the event name manually if using the custom option in the standard dropdown.

Parameters

Main Configuration

  • Pinterest Advertiser ID: Your Advertiser ID starting with 549. You can find it in Pinterest Ads under the navigation dropdown or in the browser URL.
  • API Access Token: Required to authenticate with the Pinterest Conversion API. You can obtain it in Pinterest Ads under Conversions > Conversions API > Set up API.
  • Action Source: Defines where the event originated. Select Web, Offline, App iOS or App Android, or use a variable that resolves to web, offline, app_ios or app_android (case-insensitive). Defaults to web when empty. The Event Source URL, IP address and user agent are auto-mapped for every action source.
  • Test Mode: When enabled, events are not recorded but the API returns the same response messages. Use this to verify your setup.
  • Use Optimistic Scenario: The tag will call gtmOnSuccess() immediately without waiting for a response from the API. This speeds up sGTM response time, but the tag will always report success even if the request fails.

Cookie Settings

When the epik URL parameter is present, the tag stores the Click ID in the _epik cookie.

  • Do not set Click ID (_epik) cookie: The Click ID is still sent in the request, but it is not stored as a cookie.
  • Cookie Domain: Defaults to auto, which uses the top-level domain of page_location or of the Referer header. Enter a fixed domain (e.g., example.com) to override it.
  • Cookie SameSite: None, Lax (default) or Strict.
  • Use HttpOnly cookies: Forbids JavaScript from accessing the cookie when true. Accepts variables.
  • Click ID Cookie Expiration: Cookie lifetime in days. Defaults to 365.

Server Event Data Override

Override or set server-side event parameters. Available properties:

  • Event Time
  • Event Source URL
  • Opt Out
  • Event ID
  • App id / App name / App version
  • Device brand / Device carrier / Device model / Device type
  • OS version
  • WiFi
  • Language

User Data

Override or set user data parameters sent with the event. If a parameter requires hashing (per Pinterest documentation), the tag normalizes and SHA-256 hashes it before sending, unless it is already hashed:

  • Email, first name, last name, country, external ID and MAIDs: trimmed and lowercased.
  • Phone: digits only, without leading zeros (include the country code).
  • Gender: f, m or n (female, male and non-binary are converted).
  • Date of birth: digits only (e.g., 1990-01-15 becomes 19900115).
  • City and state: lowercased, without spaces or punctuation (send the state as a two-letter code).
  • Zip: lowercased, without spaces or dashes; a US ZIP+4 is cut to 5 digits.

Values that are empty after normalization are not sent.

Available properties:

  • Email
  • Phone
  • Gender
  • Date of Birth
  • Last Name / First Name
  • City / State / Zip / Country
  • MAIDs (Mobile Advertiser IDs)
  • Client IP Address
  • Client User Agent
  • External ID
  • Click ID
  • Customer Type

Custom Data

Override or set custom/product data parameters:

  • Currency
  • Value
  • Content IDs
  • Contents
  • Num Items
  • Order ID
  • Search String
  • Opt Out Type
  • Content Name / Content Category / Content Brand
  • Predicted Lifetime Value (LTV)

Tag Execution Consent Settings

Control whether the tag respects marketing consent:

  • Send data always: The tag fires regardless of consent status.
  • Send data in case marketing consent given: Aborts execution if marketing consent (ad_storage via Google Consent Mode or Stape’s Data Tag parameter) is not granted.

Useful Resources

Open Source

The Pinterest Conversion API Tag for GTM Server-Side is developed and maintained by the Stape Team under the Apache 2.0 license.

GTM Gallery Status

:green_circle: Listed

GitHub

:green_circle: Repository

stape-io/pinterest-capi-tag — updated: view commit

  • Added a new “Custom” event type option with validation and detailed help text for defining up to 15 custom event names
  • Introduced toggles for automapping Server Event Data, User Data, and Custom Data parameters with default enabled and detailed default mapping help
  • Removed Logs Settings and BigQuery Logs Settings from configuration, disabling all logging-related features
  • Improved user data and custom data mapping logic to respect automapping toggles and handle event data more flexibly
  • Updated event name handling to return ‘custom’ if no standard mapping exists and select event name based on event type (standard or custom)

GTM Gallery Status

:green_circle: Listed

stape-io/pinterest-capi-tag — updated: view commit

  • Added automatic mapping support for SHA-256 hashed email, first name, and last name event data fields

GTM Gallery Status

:green_circle: Listed

stape-io/pinterest-capi-tag — updated: view commit

  • Added Customer Type support: auto-maps eventData.customer_type into user_data.customer_type, and it’s available as a manual user data field (“new”/“returning”)
  • Added External Measurement ID and External Measurement Vendor ID custom data fields; the vendor ID is converted to an integer
  • Test Mode is now a true/false dropdown that accepts variables instead of a checkbox
  • Grouped the event name, action source, advertiser ID, access token, test mode and optimistic scenario fields into a single configuration group
  • Fixed label casing: “App id” → “App ID”

GTM Gallery Status

:green_circle: Listed

stape-io/pinterest-capi-tag — updated: view commit

  • Added Cookie Settings group: option to skip setting the _epik Click ID cookie, plus configurable domain, SameSite, HttpOnly and expiration (default 365 days)
  • Action Source now accepts variables (case-insensitive, trimmed, falls back to web); Event Source URL, IP address and user agent are now auto-mapped for every Action Source
  • Improved user data normalization before hashing per Pinterest’s rules (phone, gender, date of birth, city/state, ZIP, etc.); already-hashed values are sent as-is and empty values are dropped
  • Updated documentation links to the Pinterest API v5 Events docs and expanded the help text on hashing and normalization
  • Renamed “Source URL” to “Event Source URL” in the auto-mapping labels

GTM Gallery Status

:green_circle: Listed