The pixel is one line of JavaScript that connects your website to Notikit. You paste it once, and from then on everything you create or change in the dashboard is reflected on your website without touching the code again.
Where to get the code
- Open Campaigns.
- On the right campaign, choose Install pixel.
- Click Copy pixel code.
The code looks like this (the key is different for each campaign):
<!-- Pixel Code - https://notikit.com/ -->
<script defer src="https://notikit.com/pixel/YOUR_PIXEL_KEY"></script>
<!-- END Pixel Code -->
Paste it before the end of the head tag of your website, on every page where you want to show notifications or record conversions.
What the pixel does on each visit
- It loads with
defer, which means it does not block your page from loading. - It checks that the domain of the page matches the campaign domain (with or without
www.). If it does not match, it does nothing. - It fetches the active notifications of the campaign that apply to that visitor according to the targeting and schedule you configured.
- It shows each notification when its triggers are met.
- It records the visit, plus the impressions, hovers and clicks of each notification.
Good to know
- One key per campaign. If you have several websites, each one uses the code of its own campaign.
- Cache. The pixel code is cached for a few minutes, so changes are not visible instantly.
- Bots. The pixel does not run for crawlers and bots, so they do not use up impressions.
- Single-page apps. The pixel detects URL changes without a reload and evaluates the triggers again.
- Quota. If your account reached the monthly impressions limit, the pixel stops showing notifications until the quota is renewed.
Installation guides
After installing it, continue with Verify the pixel installation.