What is Website Analytics and how to enable it
Website analytics is the process of collecting, analyzing, and interpreting data about how users interact with your website. This includes:
- Page visits and user behavior (clicks, scrolling, session time)
- Traffic sources (where users came from: email, social media, search engines)
- Conversions and events (form submissions, product purchases, survey completions)
- By understanding this data, businesses can optimize the user experience, personalize content, and measure the effectiveness of marketing campaigns.4
- Identify Users & Leads - Users will be identified if they are in the CRM. Anonymous users and their location and referring URL can be discovered
The Benefit
Website Analytics is your eyes and discovery engine for new leads
- It makes your email campaigns much more valuable and drives better ROI
- Learn where your new customers are coming from
- What are the favorite pages on your site
- Gives Google Analytics and more information to everyone!
- Drive automation and workflows based on your leads behavior
How to Add SAMAI Analytics to Your Website
To get started with SAMAI Analytics, all you need to do is copy and paste the following snippet into the <head> section of your website’s HTML.
Installation Steps
1. Register your domain as a Trusted Domain in SalesAndMarketing.ai. Please see this KBB for assistance.
2. Click on the Code icons next to the plus sign

3. Copy the HTML to be put in the <head> section of your website
4. Open the HTML file index.html for your website.
Locate the <head> section.
Paste the snippet before the closing </head> tag.
JavaScript snippet will be given to you when you add your website to My Analytics section. It will look something like this:
Add the following script to your website inside <head> tag:
<!-- SAMAI Analytics Tag Start -->
<samai-web-id>YOUR_UNIQUE_SAMAI_WEB_ID</samai-web-id>
<script src="https://atag.salesandmarketing.ai/js/analytics.js" defer></script>
<!-- SAMAI Analytics Tag End -->
Custom Event Tracking
Track custom interactions using the samAiTag() function:
samAiTag('event', 'signup_button_clicked', {
location: 'hero_section',
plan: 'Pro'
});
Example: Form Submission
document.querySelector("#contact-form").addEventListener("submit", () => {
samAiTag('event', 'contact_form_submitted', {
form_type: 'lead',
page: window.location.pathname
});
});
Optional Configuration
Set a project or override the website ID:
samAiTag('config', 'my-project-id', {
website_id: 'your-site-id'
});
