Situation:
- I’m the owner of the website example.com
- I want to give my customers the possibility (pixel/iframe/sth?) to check if current visitor of their website was on my website (example.com) in the last 30 days
- If she/he was on my website in the last 30 days, the dataLayer event should be fired.
Tried Iframe and embeded JS to read cookies but no success.
2
Answers
I've found a solution, but I'm afraid won't work when Chrome will disable 3rd party cookies:
I'm setting up 30 days cookie on my site (example.com)
I've prepared a simple endpoint on my site (example.com/check):
my customers can use this code to check it:
I think you can try to set
Same-Site: None
to your cookie on your website (egsomecookie
). Then your requests from anotherwebsitecom to websitecom should use it. Then you can check if request containssomecookie
.If you want to limit the cookie’s lifetime to 30 days you can use expires property.