From d640ce5fc937ef459b77116552b2d6cd74b2ce78 Mon Sep 17 00:00:00 2001 From: sabio-yateam <122805097+sabio-yateam@users.noreply.github.com> Date: Tue, 6 Jun 2023 18:57:47 +0300 Subject: [PATCH] Add uid generation to metrika analytics template The update ensures the uid is compatible with the one created by regular metrika script. --- extensions/amp-analytics/0.1/vendors/metrika.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/extensions/amp-analytics/0.1/vendors/metrika.json b/extensions/amp-analytics/0.1/vendors/metrika.json index 582fc145967c..cd25a132c599 100644 --- a/extensions/amp-analytics/0.1/vendors/metrika.json +++ b/extensions/amp-analytics/0.1/vendors/metrika.json @@ -17,6 +17,14 @@ "_pageUrl": "${sourceUrl}", "_goalUrl": "goal://${sourceHost}/${goalId}" }, + "cookies": { + "enabled": true, + "_ym_uid": { + "value": "$IF($MATCH(COOKIE(_ym_uid),^\\d{17}\\d?\\d?$),COOKIE(_ym_uid),TIMESTAMP()$SUBSTR(RANDOM(),2,6))", + "cookieMaxAge": 525600, + "sameSite": "None" + } + }, "requests": { "pageview": "${_prefix}${_pageViewBrInfo}${_brInfo}&${_siteInfo}&${_suffix}", "notBounce": "${_prefix}${_notBounceBrInfo}${_brInfo}&${_suffix}",