Implementing Google Publisher Provided Identifiers (PPID) and Secure Signals in GAM
Calling googletag.pubads().setPublisherProvidedId() in Google Publisher Tag (GPT) appends an alphanumeric string between 32 and 150 characters to the ppid

Calling googletag.pubads().setPublisherProvidedId() in Google Publisher Tag (GPT) appends an alphanumeric string between 32 and 150 characters to the ppid query parameter of the /gampad/ads ad request, yet that identifier is never transmitted verbatim in raw OpenRTB bid requests to external demand-side platforms (DSPs). Across enterprise publisher stacks, one of the most frequent architectural misconfigurations is treating Google Publisher Provided Identifiers (PPID) and Google Secure Signals as interchangeable identity mechanisms. While both protocols mitigate signal loss across Apple WebKit Intelligent Tracking Prevention (ITP), Mozilla Enhanced Tracking Protection (ETP), Apple App Tracking Transparency (ATT), and connected TV (CTV) environments lacking universal cookie storage, they operate at entirely different layers of the Google Ad Manager (GAM) auction pipeline.
PPID is a publisher-scoped, first-party identity key consumed internally by GAM 360 to unify user state across devices, enforce reservation and programmatic frequency caps, populate first-party audience segments, and control sequential creative rotation. Because PPID is isolated to a single publisher's GAM network code and shielded from external buyers to prevent unauthorized cross-site user graph compilation, passing a PPID alone does not hydrate the external bidstream with interoperable user IDs.
To pass encrypted third-party or first-party identity tokens downstream to external bidders in OpenRTB user.ext.eids arrays, publishers must pair PPID with Google Secure Signals (formerly Encrypted Signals for Publishers). Combining a deterministic or server-persisted PPID with low-latency Secure Signals injection ensures that both Google's internal auction logic and external Open Bidding, Authorized Buyers, and SDK Bidding partners can value impressions at full identity fidelity.
What Google PPID (GAM 360) Can and Cannot Do in Programmatic Auctions
Within the GAM 360 ad server architecture, a PPID acts as a synthetic cookie fallback and cross-environment stitcher tied strictly to the publisher's network namespace. When a browser or device lacks a valid IDE cookie on the doubleclick.net domain, or when an iOS application operates with a zeroed-out 00000000-0000-0000-0000-000000000000 IDFA string, GAM falls back to the PPID supplied in the ad request to recognize returning users. According to the Google Ad Manager 360 PPID documentation, this identifier enables cross-device frequency capping, audience segmentation, and sequential ad rotation using hashed or encrypted first-party identifiers derived from signed-in accounts or persistent server-set first-party cookies, while automatically disabling personalization whenever a user opts out or triggers Restricted Data Processing (RDP) or European Union consent limits.
Understanding the exact boundary of PPID inside the programmatic auction is essential when designing enterprise publisher solutions for yield optimization. When GAM conducts a unified first-price auction, PPID influences monetization through three internal mechanisms:
- Internal Google Auction Signals and Frequency Management: GAM maps the publisher's PPID to an internal, partition-isolated Google identifier. For Google demand channels (such as Google Ads and Display & Video 360 buying through AdX), this allows Google's auction infrastructure to honor buyer-defined frequency caps and evaluate publisher-curated deals without exposing the raw PPID string outside the publisher's partition.
- Programmatic Guaranteed (PG) and Preferred Deals (PD) Targeting: Publishers can build first-party Audience Solutions segments inside GAM 360 keyed off PPIDs and attach those segments to PG, PD, or Private Auction deal IDs. When an ad request arrives with a matching PPID, GAM qualifies the impression for the deal and passes the corresponding
pmp.deals[].idin the outbound bid request to the buyer. - Ad Server Reservation Allocation: By accurately counting user exposure across Safari, Firefox, mobile apps, and CTV, PPID prevents guaranteed direct-sold line items from repeatedly serving to the same cookieless user, preserving high-value user sessions for programmatic competition once a reservation frequency cap is reached.
Conversely, PPID cannot be used by an independent third-party DSP or Open Bidding SSP to look up a user in an external cross-publisher identity graph. External buyers never see the string passed into setPublisherProvidedId(). If an external DSP requires an industry-standard identifier (such as UID2, ID5, SharedID, or LiveRamp RampID) to execute DSP-side audience matching or bid shading adjustments, that token must travel through the Secure Signals pipeline or a parallel Prebid.js / Prebid Server header bidding wrapper.
Hashing Requirements, Opt-Out Rules, and Server-Side First-Party Cookie Generation
Google enforces strict syntax and cryptographic hygiene rules on every PPID ingested by GAM 360. The identifier passed to GPT, the Google Mobile Ads (GMA) SDK, or the Interactive Media Ads (IMA) SDK must meet the following specifications:
- Character Set: Strictly alphanumeric ASCII characters (
0-9,a-z,A-Z). Hyphens, underscores, colons, URL-encoded sequences, and Base64 padding characters (=,+,/) are invalid and will cause GAM to drop the identifier silently or log ad request parsing warnings. - Byte Length: Minimum of 32 characters and maximum of 150 characters. A hexadecimal SHA-256 or HMAC-SHA256 digest produces an exact 64-character alphanumeric string, making it the standard encoding format for production deployments.
- Obfuscation and Non-Reversibility: The PPID must be hashed or encrypted before leaving the publisher's infrastructure so that it is completely opaque to Google. Passing cleartext personally identifiable information (PII), such as raw email addresses, phone numbers, or unhashed resettable device IDs (IDFA, GAID, Roku RIDA, or tvOS IFA), is a direct violation of Google Platforms Program Policies and triggers immediate account enforcement.
For authenticated users, publishers should generate the PPID by computing an HMAC-SHA256 hash of the normalized account UUID or canonical email address using a confidential server-side cryptographic salt. Using HMAC-SHA256 rather than an unsalted SHA-256 hash ensures that precomputed rainbow tables of common email hashes cannot be correlated back to the publisher's PPID namespace.
For unauthenticated web sessions on Safari and iOS WebKit browsers, client-side storage mechanisms (document.cookie set via JavaScript or window.localStorage) are subject to WebKit ITP caps that purge state after 7 days of inactivity, or after 24 hours if the navigation URL contains click-tracking parameters (such as gclid or fbclid) and originates from a classified cross-site tracking domain. To maintain a durable PPID for anonymous users, publishers should generate a first-party session UUID at the CDN edge or origin server and persist it via an HTTP Set-Cookie response header served from a first-party A-record or same-site subdomain (where the server IP shares the publisher's organizational network alignment).
// 1. Edge / Server-Side Middleware (Node.js / Cloudflare Worker pattern)
import crypto from 'node:crypto';
export function resolveServerSidePpid(req, res, secretSalt) {
const existingCookie = req.cookies['__Host-sb_uid'];
const rawSeed = req.user?.accountUuid || existingCookie || crypto.randomUUID();
if (!existingCookie && !req.user?.accountUuid) {
res.setHeader(
'Set-Cookie',
`__Host-sb_uid=${rawSeed}; Path=/; Max-Age=31536000; Secure; HttpOnly; SameSite=Lax`
);
}
// Generate 64-char alphanumeric hex digest (compliant with GAM 32-150 char rule)
return crypto.createHmac('sha256', secretSalt).update(rawSeed).digest('hex');
}
// 2. Client-Side GPT Initialization with TCF v2.2 Consent Gate
window.googletag = window.googletag || { cmd: [] };
window.googletag.cmd.push(() => {
const pubads = window.googletag.pubads();
pubads.disableInitialLoad();
if (typeof window.__tcfapi === 'function') {
window.__tcfapi('addEventListener', 2, (tcData, success) => {
if (success && (tcData.eventStatus === 'tcloaded' || tcData.eventStatus === 'useractioncomplete')) {
const hasStorageConsent = tcData.purpose?.consents?.[1] === true;
if (hasStorageConsent && window.__SERVER_PPID__) {
pubads.setPublisherProvidedId(window.__SERVER_PPID__);
}
window.googletag.enableServices();
}
});
} else if (window.__SERVER_PPID__) {
pubads.setPublisherProvidedId(window.__SERVER_PPID__);
window.googletag.enableServices();
}
});
From a privacy compliance perspective, GAM automatically suppresses PPID-based personalization whenever the ad request contains privacy restriction flags. If a request includes &npa=1 (Non-Personalized Ads), &rdp=1 (Restricted Data Processing for US state privacy frameworks), &tfcd=1 (Tag for Child-Directed Treatment), or a Transparency and Consent Framework (TCF v2.2) gdpr_consent string that lacks consent for Purpose 1 (Store and/or access information on a device) and relevant personalization purposes, GAM disables audience segment evaluation and user-level personalization tied to the PPID. Even with Google's server-side safeguard, best practice dictates gating setPublisherProvidedId() on the client or SSAI stitcher until the Consent Management Platform (CMP) confirms storage permission.
Using PPID for Cross-Device Frequency Capping, Audience Segments, and Sequential Rotation
When a publisher normalizes identity around an authenticated account credential (such as an email login or QR-code pairing on a smart TV), the same 64-character HMAC-SHA256 PPID can be injected across every endpoint in the portfolio:
- Web (GPT):
googletag.pubads().setPublisherProvidedId(ppidHash) - Mobile App (GMA SDK for iOS/Android): Passed via
AdManagerAdRequest.Builder().setPublisherProvidedId(ppidHash) - CTV and Video (IMA SDK / PAL SDK / VAST SSAI): Appended as
&ppid=<ppidHash>on raw VAST ad tag requests or injected into the Programmatic Access Library (PAL)NonceRequestobject so that the encrypted&givn=nonce carries the PPID into the SSAI stitcher's upstream GAM call.
Unifying this key unlocks three high-margin monetization workflows in GAM 360:
First, cross-device frequency capping prevents impression waste across fragmented environments. Without PPID, a subscriber watching a live sports stream on an Apple TV (tvOS), checking scores on an iPhone app with ATT denied, and reading articles on desktop Safari appears to GAM as three separate users, and on Safari, as a new user every week. A line item capped at 3 impressions per day can inadvertently serve 9 or more times to the same individual, exhausting direct-sold budgets prematurely while starving the open auction of unique reach. With PPID active across all three surfaces, GAM increments a single unified counter in real time, cutting off the reservation line item after the third exposure and releasing subsequent impressions to high-CPM programmatic demand.
Second, first-party audience segmentation becomes durable on cookieless browsers. In GAM 360 Audience Solutions, publishers can build behavioral segments based on ad unit views and custom key-values (setTargeting()), or upload deterministic first-party segments via batch CSV files using PPID as the KeyType. Because the segment membership is bound to the PPID rather than a volatile third-party cookie, an audience segment built from desktop browsing behavior immediately activates when that same user launches the publisher's Samsung Tizen or Roku CTV app.
Third, sequential ad rotation operates reliably across sessions. Advertisers running multi-stage brand storytelling campaigns (Creative A followed by Creative B, then Creative C) rely on GAM to track creative delivery history per user. Passing a persistent PPID ensures that sequential rotation state survives browser restarts, ITP storage purges, and device transitions.
Google Secure Signals (Signals > Secure Signals)
While PPID resolves user identity inside Google's ad server boundary, external DSPs and SSPs require an independent mechanism to receive third-party and publisher-scoped identity tokens. Google Secure Signals, configured inside GAM under Inventory > Signals > Secure Signals (or Admin > Signals > Secure Signals depending on network UI version), bridges this gap. As detailed in the Google Ad Manager Secure Signals configuration guide, Secure Signals shares obfuscated identity tokens with Authorized Buyers, Open Bidding, SDK Bidding, and curation partners via three web deployment options: Publisher deploy, Google deploy, or automatic collection from the Prebid UserID module.
Architecturally, Secure Signals functions as an asynchronous client-side cache and transport pipe built into GPT and the GMA/IMA SDKs. When a signal provider resolves an encrypted user token, GPT stores that token in browser local storage (_gesPSK-<provider_id>) and attaches the encrypted payload to outbound /gampad/ads requests. GAM then routes those signals to eligible external buyers based on the publisher's sharing controls inside the GAM interface.
For publishers leveraging our GAM-integrated monetization stack across web, mobile app, and CTV, configuring Secure Signals alongside Prebid.js 11.x and Prebid Server is one of the highest-leverage engineering tasks available. It ensures that server-side demand channels in GAM receive the exact same Extended Identifier (eid) density that client-side header bidding adapters enjoy.
Deployment Modes: Publisher Deploy, Google Deploy, and Prebid UserID Automatic Fallback
When enabling web signal providers in the GAM UI, AdOps engineers must select the execution model that aligns with their page latency budget and header bidding topology:
- Publisher Deploy (Custom Collector Push): The publisher takes full responsibility for loading the identity provider's JavaScript library (or generating the token server-side) and registering a collector callback on the
window.googletag.secureSignalProvidersarray. This mode offers the tightest control over Core Web Vitals (specifically Interaction to Next Paint, or INP) because the publisher can resolve tokens on a background thread or server edge and hand GPT a pre-resolved string without triggering external third-party script downloads. - Google Deploy (Managed Script Injection): When toggled to Google deploy in the GAM UI, GPT automatically fetches and executes the signal provider's hosted collector script from Google's CDN infrastructure during page initialization. While this requires zero front-end code changes, the signal collector executes asynchronously; on a user's very first pageview (cold cache), the first ad request frequently fires before the external collector script finishes its network handshake, meaning the signal only populates on the second pageview or subsequent ad refresh cycles.
- Prebid UserID Module Automatic Collection: For publishers running Prebid.js with the
userIdmodule compiled into their build, GPT can automatically read resolved user IDs directly from Prebid's identity submodules (pbjs.getUserIdsAsEids()) without firing redundant collector network requests. When "Allow Prebid UserID module to automatically collect signals" is enabled in GAM's Secure Signals settings, GPT inspects the active Prebid instance on the page and maps supported identity providers directly into the GAM ad request.
// Production Hybrid Setup: Prebid.js 11.x UserID + Explicit GPT Secure Signals Fallback
window.pbjs = window.pbjs || { que: [] };
window.googletag = window.googletag || { cmd: [], secureSignalProviders: [] };
window.pbjs.que.push(() => {
window.pbjs.setConfig({
userSync: {
auctionDelay: 50, // Max 50ms delay on cold cache; 0ms when localStorage is warm
userIds: [
{
name: 'sharedId',
storage: { type: 'cookie', name: '_pubcid', expires: 365 }
},
{
name: 'uid2',
params: {
serverPublicKey: 'UID2-X-P-MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE...',
subscriptionId: 'pub_sub_99481a'
},
storage: { type: 'html5', name: 'pbjs_uid2', expires: 30 }
}
]
}
});
});
// Explicit Publisher Deploy push for custom or first-party encrypted signals
window.googletag.secureSignalProviders.push({
id: 'pub-custom-signal-provider',
collectorFunction: async () => {
try {
// Read pre-cached encrypted token from localStorage to guarantee <5ms resolution
const cachedToken = window.localStorage.getItem('__sb_encrypted_signal');
if (cachedToken) return cachedToken;
const response = await fetch('/api/v1/identity/mint-signal', {
method: 'GET',
credentials: 'same-origin'
});
if (!response.ok) return '';
const { encryptedToken } = await response.json();
window.localStorage.setItem('__sb_encrypted_signal', encryptedToken);
return encryptedToken;
} catch (err) {
return '';
}
}
});
In high-throughput production setups, relying solely on cold asynchronous network calls inside collectorFunction introduces race conditions against the Prebid auction timeout curve. If googletag.pubads().refresh() fires at t = 400ms and the identity endpoint takes 450ms to respond, the initial impression goes to auction without signals. Hydrating the token server-side into the HTML document or enforcing a brief userSync.auctionDelay (typically 30-50ms) ensures the initial above-the-fold auction carries full signal coverage.
Sharing Secure Signals with Authorized Buyers, Open Bidding, SDK Bidding, and Curation Partners
Once GPT or the GMA SDK captures a Secure Signal, GAM governs downstream distribution through granular per-partner toggles in the Signals > Secure Signals matrix. Publishers can independently enable or disable signal passthrough across four distinct programmatic demand pipes:
- Authorized Buyers (AdX DSPs): When shared with Authorized Buyers, GAM populates the encrypted signal payload inside the outbound bid request (mapped to
user.ext.eidsin OpenRTB 2.6 or theencrypted_signalprotobuf field in Google's native protocol). DSPs decrypt or match the token against their internal audience graphs, allowing them to bid on remarketing, lookalike, and frequency-capped campaigns on Safari, Firefox, and iOS traffic where third-party cookie matching is zero. - Open Bidding (OB) and Open Bidding Direct Pay: Server-to-server exchanges connected via GAM Open Bidding suffer an inherent architectural disadvantage compared to client-side Prebid.js adapters: because the auction call originates from Google's data centers rather than the user's browser, Open Bidding SSPs cannot read their own domain cookies directly during the request. Enabling Secure Signals sharing for Open Bidding partners injects the resolved
eidsarray into the server-to-server OpenRTB payload, closing the match-rate gap between client-side header bidding and Open Bidding. - SDK Bidding (In-App Mobile): On iOS 14.5+ where ATT opt-in rates hover between 15% and 25% across mainstream utility and news apps, SDK Bidding mediation partners connected via GMA Next-Gen SDK rely on Secure Signals adapters initialized inside the application lifecycle to receive hashed or encrypted identity tokens in place of the IDFA.
- Curation Partners: Data platforms and agency curation desks operating inside GAM's curation ecosystem consume Secure Signals to match publisher inventory against off-site audience segments, packaging matched impressions into deal IDs without requiring the publisher to host third-party sync pixels.
| Architectural Dimension | Google PPID (GAM 360) | Google Secure Signals (GAM Standard & 360) |
|---|---|---|
| Primary Consumer | Internal GAM 360 ad server & Google auction logic | External Authorized Buyers, Open Bidding, SDK Bidding, Curators |
| Data Format | 32-150 char alphanumeric hash (e.g., 64-char HMAC-SHA256 hex) | Provider-specific encrypted or obfuscated token (user.ext.eids) |
| Raw Exposure in Bidstream | Never exposed to external DSPs or SSPs | Passed directly to permitted buyers in OpenRTB / Protobuf requests |
| Core Monetization Use Case | Cross-device frequency caps, 1P Audience Solutions, sequential rotation | Restoring external DSP match rates, bid density, and clearing prices |
| Ingestion API (Web) | googletag.pubads().setPublisherProvidedId(id) |
googletag.secureSignalProviders.push(...) or Prebid UserID sync |
To verify that both pipelines are operating at peak efficiency, AdOps teams should audit two metrics weekly inside GAM reporting: first, run a GAM Historical report segmented by PPID presence across Safari and iOS inventory to confirm that over 95% of consented impressions carry a valid 64-character hash; second, inspect the Signal presence rate and eCPM by Signal status metrics inside the Signals > Secure Signals dashboard. If signal presence lags behind total ad requests on first-pageview sessions, move token generation from asynchronous client-side fetches to synchronous server-side cookie hydration, ensuring every auction starts with complete internal and external identity coverage.