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

Function getAttributionReportingStatusUrlVariableRewriter

src/pixel.js:152–169  ·  view source on GitHub ↗

* @param {!Window} win * @param {string=} status * @param {(Element|./service/ampdoc-impl.AmpDoc)=} opt_elementOrAmpDoc Whether services are provided by an * element. * @return {function(string): string}

(
  win,
  status,
  opt_elementOrAmpDoc
)

Source from the content-addressed store, hash-verified

150 * @return {function(string): string}
151 */
152function getAttributionReportingStatusUrlVariableRewriter(
153 win,
154 status,
155 opt_elementOrAmpDoc
156) {
157 const substitutionFunctions = {
158 'ATTRIBUTION_REPORTING_STATUS': () => status,
159 };
160 const replacements = Services.urlReplacementsForDoc(
161 opt_elementOrAmpDoc || win.document
162 );
163 const allowlist = {
164 'ATTRIBUTION_REPORTING_STATUS': true,
165 };
166
167 return (url) =>
168 replacements.expandUrlSync(url, substitutionFunctions, allowlist);
169}

Callers 1

createImagePixelFunction · 0.85

Calls 1

expandUrlSyncMethod · 0.80

Tested by

no test coverage detected