* 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)
| 569 | * @return {!JsonObject} |
| 570 | */ |
| 571 | function 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. |
no outgoing calls
no test coverage detected