Skip to content

Commit

Permalink
Merge pull request #6 from stape-io/added-common-cookie-support
Browse files Browse the repository at this point in the history
Added common cookie support
  • Loading branch information
Bukashk0zzz committed Jul 12, 2024
2 parents a2ecf5f + ebce7f4 commit 3daf7e6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions metadata.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion template.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
7 changes: 6 additions & 1 deletion template.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -318,6 +319,10 @@ ___SERVER_PERMISSIONS___
{
"type": 1,
"string": "page_location"
},
{
"type": 1,
"string": "common_cookie"
}
]
}
Expand Down

0 comments on commit 3daf7e6

Please sign in to comment.