MCPcopy Index your code
hub / github.com/ampproject/amphtml / getPropensity

Method getPropensity

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

* @param {string} referrer * @param {string} type * @return {?Promise<../api/propensity-api.PropensityScore>}

(referrer, type)

Source from the content-addressed store, hash-verified

18559 * @return {?Promise<../api/propensity-api.PropensityScore>}
18560 */
18561 getPropensity(referrer, type) {
18562 const init = /** @type {!../utils/xhr.FetchInitDef} */ ({
18563 method: 'GET',
18564 credentials: 'include',
18565 });
18566 const url =
18567 adsUrl('/subopt/pts?products=') +
18568 this.publicationId_ +
18569 '&type=' +
18570 type +
18571 '&ref=' +
18572 referrer;
18573 return this.fetcher_
18574 .fetch(this.propensityUrl_(url), init)
18575 .then((result) => result.json())
18576 .then((response) => {
18577 return this.parsePropensityResponse_(response);
18578 });
18579 }
18580}
18581
18582/**

Callers

nothing calls this directly

Calls 6

propensityUrl_Method · 0.95
adsUrlFunction · 0.85
thenMethod · 0.45
fetchMethod · 0.45
jsonMethod · 0.45

Tested by

no test coverage detected