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

Function firstimpression

ads/vendors/firstimpression.js:9–26  ·  view source on GitHub ↗
(global, data)

Source from the content-addressed store, hash-verified

7 * @param {!Object} data
8 */
9export function firstimpression(global, data) {
10 validateData(data, ['zoneId', 'websiteId']);
11
12 const {hash, search} = global.context.location;
13 const parameters = Object.assign(
14 parseQueryString(hash),
15 parseQueryString(search)
16 );
17
18 const cdnHost =
19 'https://' + (parameters['fi_ecdnhost'] || 'ecdn.firstimpression.io');
20
21 const cdnpath = parameters['fi_ecdnpath'] || '/static/js/fiamp.js';
22
23 global.params = data;
24
25 writeScript(global, cdnHost + cdnpath);
26}

Callers

nothing calls this directly

Calls 4

validateDataFunction · 0.90
parseQueryStringFunction · 0.90
writeScriptFunction · 0.90
assignMethod · 0.80

Tested by

no test coverage detected