Skip to content

Commit 3157b56

Browse files
Add Scarf Pixel with cookie consent to script bundle (#334)
Co-authored-by: Mark Woulfe <[email protected]>
1 parent 9c70478 commit 3157b56

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-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)

src/js/site.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import './24-graphacademy-certification'
1919
import './23-yelp-agreement'
2020
import './25-graphgist'
2121
// import './30-personalisation'
22+
import './31-scarf-pixel'
2223
import './40-challenges'
2324
import './50-cheat-sheet-toggle'
2425
import './60-docs-roles'

0 commit comments

Comments
 (0)