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

Function createPixel

src/pixel.js:25–40  ·  view source on GitHub ↗
(
  win,
  src,
  referrerPolicy,
  attributionSrc,
  opt_elementOrAmpDoc
)

Source from the content-addressed store, hash-verified

23 * @return {!Element}
24 */
25export function createPixel(
26 win,
27 src,
28 referrerPolicy,
29 attributionSrc,
30 opt_elementOrAmpDoc
31) {
32 // Caller need to verify window is not destroyed when creating pixel
33 if (referrerPolicy && referrerPolicy !== 'no-referrer') {
34 user().error(TAG, 'Unsupported referrerPolicy: %s', referrerPolicy);
35 }
36
37 return referrerPolicy === 'no-referrer'
38 ? createNoReferrerPixel(win, src, attributionSrc, opt_elementOrAmpDoc)
39 : createImagePixel(win, src, false, attributionSrc, opt_elementOrAmpDoc);
40}
41
42/**
43 * @param {!Window} win

Callers 2

trigger_Method · 0.90
sendRequestUsingImageMethod · 0.90

Calls 4

userFunction · 0.90
createNoReferrerPixelFunction · 0.85
createImagePixelFunction · 0.85
errorMethod · 0.45

Tested by

no test coverage detected