Skip to content

Commit 6e9524e

Browse files
ereckersMarkWoulfeNeo4j
authored andcommitted
Add Scarf Pixel with cookie consent to script bundle (#334)
Co-authored-by: Mark Woulfe <mark.woulfe@neotechnology.com>
1 parent f3990b7 commit 6e9524e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/js/31-scarf-pixel.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// This script is used to load a pixel for Scarf analytics, but only if the user has accepted marketing cookies
2+
window.addEventListener('CookiebotOnAccept', function () {
3+
if (Cookiebot.consent.marketing) {
4+
var img = document.createElement('img')
5+
img.src = 'https://static.neo4j.com/a.png?x-pxid=dae9b690-6a56-4889-a951-9d0207a18da6'
6+
img.referrerPolicy = 'no-referrer-when-downgrade'
7+
img.style.display = 'none'
8+
document.body.appendChild(img)
9+
}
10+
}, false)

0 commit comments

Comments
 (0)