Get LeadPulse up and running on your website in 5 minutes.
Prerequisites
- A MarketSage account (Sign up free)
- Access to your website's HTML (ability to add scripts to
<head>) - A cookie consent banner (required for GDPR/NDPR compliance)
Quick Start
Step 1: Get Your Tracking Code
- Log into your MarketSage dashboard
- Go to LeadPulse → Setup
- Copy your unique tracking code
Your tracking code looks like this:
<!-- LeadPulse Tracking Code - GDPR/NDPR Compliant v2.2.0 -->
<script>
(function(w, d, p) {
const pixelId = 'lp_YOUR_UNIQUE_ID';
const endpoint = 'https://marketsage.africa/api/leadpulse';
const config = {
waitForConsent: true // GDPR/NDPR compliant by default
};
// ... full tracking code here
})(window, document);
</script>Step 2: Add Code to Your Website
Add the tracking code to the <head> section of every page you want to track.
Plain HTML
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
<!-- LeadPulse Tracking Code -->
<script>
(function(w, d, p) {
// Your tracking code here
})(window, document);
</script>
</head>
<body>
<!-- Your content -->
</body>
</html>Next.js (App Router)
import Script from 'next/script'
export default function RootLayout({ children }) {
return (
<html>
<head>
<Script id="leadpulse" strategy="afterInteractive">
{`
(function(w, d, p) {
// Your LeadPulse tracking code here
})(window, document);
`}
</Script>
</head>
<body>{children}</body>
</html>
)
}WordPress
- Go to Appearance → Theme Editor
- Click header.php in the right sidebar
- Find the
</head>tag - Paste your LeadPulse code just before
</head> - Click Update File
Step 3: Implement Consent Integration
Required: LeadPulse waits for consent by default. You must integrate with your cookie banner. See the Consent Implementation Guide.
Quick example for custom banner:
<script>
// When user accepts cookies
document.getElementById('accept-cookies').addEventListener('click', function() {
if (window.LeadPulse) {
window.LeadPulse.grantConsent();
}
});
</script>Step 4: Verify Installation
- Open your website in an incognito/private window
- Open DevTools (F12)
- Go to Console tab
- You should see:
[LeadPulse] Waiting for explicit consent... - Accept cookies on your banner
- You should see:
[LeadPulse] Consent granted, initializing tracking
Success! LeadPulse is now tracking your visitors.
What Gets Tracked?
LeadPulse automatically tracks:
| Event Type | Description |
|---|---|
| Page Views | Every page visit with URL, title, referrer |
| Clicks | Button and link clicks |
| Forms | Form submissions (no form data collected) |
| Scroll Depth | How far users scroll on pages |
| Exit Intent | When users are about to leave |
| Time on Page | Session duration and engagement |
| UTM Parameters | Campaign tracking from URLs |
| Device Data | Browser, OS, screen size (anonymous) |
Tracking Custom Events
// Track a button click
LeadPulse.track('button_click', {
button_name: 'Sign Up',
location: 'hero_section'
});
// Track a download
LeadPulse.track('file_download', {
file_name: 'whitepaper.pdf',
file_size: '2.5MB'
});Identifying Visitors
When you know who a visitor is (e.g., after login), identify them:
LeadPulse.identify({
email: 'user@example.com',
name: 'John Doe',
company: 'Acme Inc',
plan: 'pro'
});