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

Function csiTrigger

ads/google/a4a/utils.js:571–586  ·  view source on GitHub ↗

* Returns amp-analytics config for a new CSI trigger. * @param {string} on The name of the analytics trigger. * @param {!{[key: string]: string}} params Params to be included on the ping. * @return {!JsonObject}

(on, params)

Source from the content-addressed store, hash-verified

569 * @return {!JsonObject}
570 */
571function csiTrigger(on, params) {
572 return {
573 'on': on,
574 'request': 'csi',
575 'sampleSpec': {
576 // Pings are sampled on a per-pageview basis. A prefix is included in the
577 // sampleOn spec so that the hash is orthogonal to any other sampling in
578 // amp.
579 'sampleOn': 'a4a-csi-${pageViewId}',
580 'threshold': 1, // 1% sample
581 },
582 'selector': 'amp-ad',
583 'selectionMethod': 'closest',
584 'extraUrlParams': params,
585 };
586}
587
588/**
589 * Returns amp-analytics config for Google ads network impls.

Callers 1

getCsiAmpAnalyticsConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected