Overview
This guide shows you how to install Sona's lightweight tracking pixel, just 2KB, on your web application to de-anonymize traffic, attribute marketing investments, understand user behavior, calculate intent signals, track customer journeys, and more. You will learn the difference between tracking anonymous and identified users and how to properly implement the pixel for maximum effect. With this setup, you start gaining valuable insight into who is visiting your site and how they engage with your content.
When to use this
Install the Sona tracking pixel when you want to:
De-anonymize website traffic and identify visitors.
Track customer journeys across your web application.
Understand user behavior on both public and private pages.
Connect website activity to known contacts and accounts.
Before you begin, make sure you have:
Code access: access to your website's HTML or content management system, and the ability to edit the
<head>section of your pages.A Sona account: an active Sona account with tracking pixel access.
Optional GTM access: Google Tag Manager access, if you plan to use the alternative installation method.
Choosing your tracking script type
Sona offers two script types, and the right one depends on the page:
Identified Users: use this on pages that require login, such as dashboards, account pages, and member areas.
Anonymous Users: use this on public pages, such as your homepage, landing pages, and marketing content.
Each page can have only one script, but different pages can use different script types. To copy the right one, navigate to your Sona tracking pixel settings, select either Anonymous Users or Identified Users based on the page type, and click Copy to Clipboard.
Installing the tracking script
Once you have copied the appropriate script, add it to your page:
Locate your page's HTML head section. Access your website's HTML or CMS editor and find the
<head>tags in your page template or individual page.Paste the tracking script. Insert the copied script between the opening
<head>and closing</head>tags, before any other tracking or analytics code where possible.Save and publish your changes. Save your HTML or publish through your CMS. The tracking pixel begins collecting data immediately.
Best practices
Anonymous Users script: captures visitor data without requiring login, ideal for lead generation and early-stage tracking.
Identified Users script: links activity to known user accounts, ideal for post-login behavior analysis and customer journey mapping.
Single script rule: install only one tracking script per page to avoid conflicts.
Mixed implementation: different pages can use different script types based on their function.
Head placement: always place the script in the
<head>section for optimal loading and data capture.Performance: the 2KB script size keeps the impact on page load times minimal.
Reliability: a custom tracking domain (CNAME) improves reliability, and direct HTML installation avoids ad blocker interference better than Google Tag Manager. Use GTM only if direct installation is not feasible.
FAQs
What is the difference between the anonymous and identified scripts?
What is the difference between the anonymous and identified scripts?
The Anonymous Users script captures visitor data without requiring a login, which suits public pages and lead generation. The Identified Users script links activity to known accounts, which suits logged-in areas and customer journey mapping. Use the script that matches each page's context, and never put both on the same page.
Can I use more than one script on a page?
Can I use more than one script on a page?
No. Install only one tracking script per page to avoid conflicts. You can still mix script types across your site, using the identified script on logged-in pages and the anonymous script on public pages, as long as each individual page has just one.
Should I install with Google Tag Manager?
Should I install with Google Tag Manager?
Direct HTML installation in the <head> section is the most reliable option, since scripts loaded through Google Tag Manager can be blocked by ad blockers. Use GTM only when editing your site's HTML directly is not feasible, and consider a custom tracking domain to further improve reliability.
