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

Function getCsiAmpAnalyticsConfig

ads/google/a4a/utils.js:592–630  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

590 * @return {!JsonObject}
591 */
592export function getCsiAmpAnalyticsConfig() {
593 return {
594 'requests': {
595 'csi': 'https://csi.gstatic.com/csi?',
596 },
597 'transport': {'xhrpost': false},
598 'triggers': {
599 'adRequestStart': csiTrigger('ad-request-start', {
600 // afs => ad fetch start
601 'met.a4a': 'afs_lvt.${viewerLastVisibleTime}~afs.${time}',
602 }),
603 'adResponseEnd': csiTrigger('ad-response-end', {
604 // afe => ad fetch end
605 'met.a4a': 'afe.${time}',
606 }),
607 'adRenderStart': csiTrigger('ad-render-start', {
608 // ast => ad schedule time
609 // ars => ad render start
610 'met.a4a':
611 'ast.${scheduleTime}~ars_lvt.${viewerLastVisibleTime}~ars.${time}',
612 'qqid': '${qqid}',
613 }),
614 'adIframeLoaded': csiTrigger('ad-iframe-loaded', {
615 // ail => ad iframe loaded
616 'met.a4a': 'ail.${time}',
617 }),
618 },
619 'extraUrlParams': {
620 's': 'ampad',
621 'ctx': '2',
622 'c': '${correlator}',
623 'slotId': '${slotId}',
624 // Time that the beacon was actually sent. Note that there can be delays
625 // between the time at which the event is fired and when ${nowMs} is
626 // evaluated when the URL is built by amp-analytics.
627 'puid': '${requestCount}~${timestamp}',
628 },
629 };
630}
631
632/**
633 * Returns variables to be included in the amp-analytics event for A4A.

Callers 2

getA4aAnalyticsConfigMethod · 0.90
getA4aAnalyticsConfigMethod · 0.90

Calls 1

csiTriggerFunction · 0.85

Tested by

no test coverage detected