(a4a, opt_experimentIds)
| 180 | * @return {!{[key: string]: null|number|string}} block level parameters |
| 181 | */ |
| 182 | export function googleBlockParameters(a4a, opt_experimentIds) { |
| 183 | const {element: adElement, win} = a4a; |
| 184 | const slotRect = getPageLayoutBoxBlocking(adElement); |
| 185 | const iframeDepth = iframeNestingDepth(win); |
| 186 | const enclosingContainers = getEnclosingContainerTypes(adElement); |
| 187 | if ( |
| 188 | a4a.uiHandler.isStickyAd() && |
| 189 | !enclosingContainers.includes(ValidAdContainerTypes['AMP-STICKY-AD']) |
| 190 | ) { |
| 191 | enclosingContainers.push(ValidAdContainerTypes['AMP-STICKY-AD']); |
| 192 | } |
| 193 | let eids = adElement.getAttribute(EXPERIMENT_ATTRIBUTE); |
| 194 | if (opt_experimentIds) { |
| 195 | eids = mergeExperimentIds(opt_experimentIds, eids); |
| 196 | } |
| 197 | const aexp = adElement.getAttribute(AMP_EXPERIMENT_ATTRIBUTE); |
| 198 | return { |
| 199 | 'adf': DomFingerprint.generate(adElement), |
| 200 | 'nhd': iframeDepth, |
| 201 | 'eid': eids, |
| 202 | 'adx': Math.round(slotRect.left), |
| 203 | 'ady': Math.round(slotRect.top), |
| 204 | 'oid': '2', |
| 205 | 'act': enclosingContainers.length ? enclosingContainers.join() : null, |
| 206 | // aexp URL param is separated by `!`, not `,`. |
| 207 | 'aexp': aexp ? aexp.replace(/,/g, '!') : null, |
| 208 | }; |
| 209 | } |
| 210 | |
| 211 | /** |
| 212 | * @param {!../../../src/service/ampdoc-impl.AmpDoc} ampdoc |
no test coverage detected