The Snippet
This is the code you need to add to your website. You can find your uniquePROJECT_ID
in the Fidero dashboard.
How to Install
For the Pixel to function correctly, it must be present on every page of your site. The best way to achieve this is to add it to a shared<head>
section in your site’s HTML templates.
- Locate your global head: Find the HTML file or template that contains the
<head>
tag for all pages on your site. This is often in a file likeindex.html
,_document.js
,base.html
orheader.php
- Paste the snippet: Copy the snippet and paste it just before the closing
</head>
tag - Replace the Project ID: Change the placeholder
YOUR_PROJECT_ID
to your actual Project ID
Place the Pixel in the
<head>
, not the <body>
. This ensures we capture attribution data from the very first millisecond – including those crucial click IDs that disappear after redirects. Missing this first-page data means lost conversions in your reports.What the Snippet Does
The snippet is designed to be completely asynchronous and non-blocking, so it won’t affect your site’s performance. Here’s what it does:- Creates the
window.fidero
object: This object contains all the methods you’ll use to interact with the SDK - Buffers API Calls: It creates a queue (
fidero.buffered
) so that any API calls you make (likefidero.track()
) before the full SDK has loaded are safely stored - Asynchronously Fetches the SDK: The
fidero.load()
command injects a<script>
tag that fetches the full SDK from our CDN without blocking the rendering of your page - Initialises your Project:
fidero.init("YOUR_PROJECT_ID")
tells the SDK which project configuration to load from our servers - Tracks the First Page View:
fidero.page()
is called to record the initial page view, capturing the crucial first-touch attribution data