diff --git a/metadata.yaml b/metadata.yaml index 2a2ab04..425f6e3 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -1,5 +1,7 @@ homepage: "https://stape.io/" versions: + - sha: 35970e2dcc960da5325bfdadaf4eb30d572ac949 + changeNotes: Added common cookie support. - sha: 5c9555f534a50c64cec537e69686fc4c5a11e1a6 changeNotes: Added Click Id Override support. - sha: dd6d17a977aa103f3fb75b91ea35014264b72b90 diff --git a/template.js b/template.js index eac757d..a501ba1 100644 --- a/template.js +++ b/template.js @@ -36,7 +36,8 @@ if (data.type === 'page_view') { data.gtmOnSuccess(); } else { - const clickId = data.clickId || getCookieValues('taboola_cid')[0] || ''; + const commonCookie = getEventData('common_cookie') || {}; + const clickId = data.clickId || getCookieValues('taboola_cid')[0] || commonCookie.taboola_cid || ''; if (!clickId) { data.gtmOnSuccess(); diff --git a/template.tpl b/template.tpl index fb5a4aa..ff62692 100644 --- a/template.tpl +++ b/template.tpl @@ -218,7 +218,8 @@ if (data.type === 'page_view') { data.gtmOnSuccess(); } else { - const clickId = data.clickId || getCookieValues('taboola_cid')[0] || ''; + const commonCookie = getEventData('common_cookie') || {}; + const clickId = data.clickId || getCookieValues('taboola_cid')[0] || commonCookie.taboola_cid || ''; if (!clickId) { data.gtmOnSuccess(); @@ -318,6 +319,10 @@ ___SERVER_PERMISSIONS___ { "type": 1, "string": "page_location" + }, + { + "type": 1, + "string": "common_cookie" } ] }