In its latest update, Notion announced enhanced capabilities for creating and publishing websites from regular pages within this note-taking editor. Users can now index their pages, manage custom domains, small header elements, and most importantly, integrate Google Analytics code.
One of the barriers to turning Notion into a full-fledged site editor has been the inability to insert custom scripts and customize HTML/CSS—at least out of the box. Now, however, users can at least place GA4 code directly into the page settings, which can be a significant advantage for creators publishing public content on Notion. These authors can now track traffic and behavioral metrics (including automatic events) for their Notion publications.
There are two important caveats:
1. This feature is available only with the Plus plan.
2. If you do not connect a custom domain, your pages will be published on the notion.site subdomain. Visitors to this website will see a cookie usage banner. Until they accept these terms (by clicking "Accept all"), their visit data will not be sent to GA4.
This is somewhat inconvenient since most Notion sites are single-page. Users might leave after getting the information they need without clicking the banner, resulting in no visit data being sent to GA4.
Moreover — and this is amusing — if I accept cookie usage on one of the notion site subdomains, it applies to all other second-level domains. So, if I accept cookies on example notion site, GA4 requests will be sent when I visit any other notion site subdomain.
There is still one question:
Is cookie usage managed differently on custom domains? If so, how?
Does anyone have any ideas?
If you work with GA4 to BigQuery exports, be sure to check out my SQL cheat sheet.