Install the pixel on an HTML website

Created on 23 November, 2026 • Install the pixel • 28 views • 1 minutes read

Paste the Notikit pixel code in the head of your HTML website or in the shared template of your project.

If you have access to the code of your website, installing the pixel means pasting one line in the header of your pages.

Before you start

  • Have the campaign created with the right domain: Create your first campaign.
  • Copy the code from Campaigns, option Install pixel, button Copy pixel code.

Steps

  1. Open the HTML file of your page in your code editor.
  2. Find the closing </head> tag.
  3. Paste the pixel code right before that tag.
  4. Save the file and upload it to your server.

The result looks like this:

<head>
  <title>My website</title>
  ...
  <!-- Pixel Code - https://notikit.com/ -->
  <script defer src="https://notikit.com/pixel/YOUR_PIXEL_KEY"></script>
  <!-- END Pixel Code -->
</head>

If your website has several pages

The pixel must be on every page where you want to show notifications or capture forms. The most practical way is to paste it in the file shared by all pages: the base template, the layout or the header file included by your website or framework. That way you install it only once.

If you cannot edit the head

The code uses the defer attribute, so it also works if you paste it before the closing </body> tag. What matters is that the code is present on the page exactly as you copied it, without changing the URL or the key.

Common mistakes

  • Pasting the code of another campaign: each campaign has its own key and only works on its domain.
  • Testing the website from localhost or from a staging address that differs from the campaign domain: the pixel shows nothing if the domain does not match.
  • Pasting the code as visible text instead of as HTML.

When you are done, continue with Verify the pixel installation.