MCPcopy Create free account
hub / github.com/ampproject/amphtml / getClientId_

Method getClientId_

third_party/subscriptions-project/swg.js:18388–18399  ·  view source on GitHub ↗

* Returns the client ID to be used. * @return {?string} * @private

()

Source from the content-addressed store, hash-verified

18386 * @private
18387 */
18388 getClientId_() {
18389 if (!this.clientId_) {
18390 // Match '__gads' (name of the cookie) dropped by Ads Tag.
18391 const gadsmatch = this.getDocumentCookie_().match(
18392 '(^|;)\\s*__gads\\s*=\\s*([^;]+)'
18393 );
18394 // Since the cookie will be consumed using decodeURIComponent(),
18395 // use encodeURIComponent() here to match.
18396 this.clientId_ = gadsmatch && encodeURIComponent(gadsmatch.pop());
18397 }
18398 return this.clientId_;
18399 }
18400
18401 /**
18402 * @private

Callers 1

propensityUrl_Method · 0.95

Calls 2

getDocumentCookie_Method · 0.95
popMethod · 0.45

Tested by

no test coverage detected