Quick Start Installation
Step 1: Get Your Account ID
Before installation, you'll need your unique Sealmetrics Account ID. This is a 24-character identifier that looks like: 000000000000000000001234
You can find your Account ID in your Sealmetrics dashboard under Settings > Installation.
Step 2: Basic Pageview Tracking
Copy and paste this code into the <head>
section of every page you want to track:
<script>
/* SealMetrics Tracker Code */
(function() {
var options = {
account: 'YOUR_ACCOUNT_ID_HERE',
event: 'pageview',
use_session: 1,
};
var url="//app.sealmetrics.com/tag/v2/tracker";function loadScript(callback){var script=document.createElement("script");script.src=url;script.async=true;script.onload=function(){if(typeof callback==="function"){callback();}};script.onerror=function(){console.error("Error loading script: "+url);};document.getElementsByTagName("head")[0].appendChild(script);}loadScript(function(){options.id=Math.floor((Math.random()*999)+1);if(window.sm){var instance=new window.sm(options);instance.track(options.event);}else{console.error("sm2 plugin is not available");}});
})();
/* End SealMetrics Tracker Code */
</script>
Important: Replace YOUR_ACCOUNT_ID_HERE
with your actual Account ID.
Step 3: Verify Installation
Install the code on your website
Visit a page with the tracking code
Check your Sealmetrics dashboard for real-time data (may take a few minutes)
Look for the page view in your analytics
Advanced Installation Options
Custom Event Tracking
For tracking specific actions like form submissions, downloads, or button clicks:
<script>
/* SealMetrics Event Tracker Code */
(function() {
var options = {
account: 'YOUR_ACCOUNT_ID_HERE',
event: 'microconversion',
label: 'Contact Form Submission',
ignore_pageview: 1,
use_session: 1,
};
var url="//app.sealmetrics.com/tag/v2/tracker";function loadScript(callback){var script=document.createElement("script");script.src=url;script.async=true;script.onload=function(){if(typeof callback==="function"){callback();}};script.onerror=function(){console.error("Error loading script: "+url);};document.getElementsByTagName("head")[0].appendChild(script);}loadScript(function(){options.id=Math.floor((Math.random()*999)+1);if(window.sm){var instance=new window.sm(options);instance.track(options.event);}else{console.error("sm2 plugin is not available");}});
})();
/* End SealMetrics Event Tracker Code */
</script>
E-commerce Purchase Tracking
For tracking sales and revenue:
<script>
/* SealMetrics Purchase Tracker Code */
(function() {
var options = {
account: 'YOUR_ACCOUNT_ID_HERE',
event: 'purchase',
label: 'Online Purchase',
value: 99.99,
currency: 'USD',
ignore_pageview: 1,
use_session: 1,
};
var url="//app.sealmetrics.com/tag/v2/tracker";function loadScript(callback){var script=document.createElement("script");script.src=url;script.async=true;script.onload=function(){if(typeof callback==="function"){callback();}};script.onerror=function(){console.error("Error loading script: "+url);};document.getElementsByTagName("head")[0].appendChild(script);}loadScript(function(){options.id=Math.floor((Math.random()*999)+1);if(window.sm){var instance=new window.sm(options);instance.track(options.event);}else{console.error("sm2 plugin is not available");}});
})();
/* End SealMetrics Purchase Tracker Code */
</script>
Installation Methods
Method 1: HTML Integration (Recommended)
For Static Websites:
Add the basic pageview code to your HTML template's
<head>
sectionAdd event tracking codes where specific actions occur
Replace Account ID in all instances
For WordPress:
Go to Appearance > Theme Editor
Edit
header.php
Add the code before the closing
</head>
tagSave changes
For Shopify:
Go to Online Store > Themes
Click Actions > Edit Code
Edit
theme.liquid
Add the code before
</head>
Save changes
Method 2: Google Tag Manager
Setup Steps:
Create a new Custom HTML tag in GTM
Paste the Sealmetrics tracking code
Set trigger to "All Pages" for pageview tracking
Create additional tags for custom events
Publish the container
GTM Custom HTML Tag:
<script>
/* SealMetrics GTM Integration */
(function() {
var options = {
account: 'YOUR_ACCOUNT_ID_HERE',
event: 'pageview',
use_session: 1,
};
var url="//app.sealmetrics.com/tag/v2/tracker";function loadScript(callback){var script=document.createElement("script");script.src=url;script.async=true;script.onload=function(){if(typeof callback==="function"){callback();}};script.onerror=function(){console.error("Error loading script: "+url);};document.getElementsByTagName("head")[0].appendChild(script);}loadScript(function(){options.id=Math.floor((Math.random()*999)+1);if(window.sm){var instance=new window.sm(options);instance.track(options.event);}else{console.error("sm2 plugin is not available");}});
})();
</script>
Method 3: WordPress Plugin
Install the official Sealmetrics WordPress plugin
Go to Settings > Sealmetrics
Enter your Account ID
Configure tracking options
Save settings
Configuration Parameters
Required Parameters
Parameter | Description | Example |
| Your Sealmetrics Account ID |
|
| Type of event to track |
|
Optional Parameters
Parameter | Description | Example | Default |
| Enable session tracking |
|
|
| Custom event label |
|
|
| Monetary value |
|
|
| Currency code |
|
|
| Skip automatic pageview |
|
|
Event Types
Event Type | Purpose | When to Use |
| Page view tracking | Automatic page tracking |
| Lead generation events | Form submissions, signups |
| E-commerce transactions | Completed purchases |
| File downloads | PDF, software downloads |
| Video engagement | Video play events |
| Custom business events | Any business-specific action |
Implementation Examples
Form Submission Tracking
<!-- Contact Form -->
<form id="contact-form" onsubmit="trackFormSubmission()">
<!-- form fields -->
<button type="submit">Submit</button>
</form>
β
<script>
function trackFormSubmission() {
// Sealmetrics event tracking
(function() {
var options = {
account: 'YOUR_ACCOUNT_ID_HERE',
event: 'microconversion',
label: 'Contact Form Submission',
ignore_pageview: 1,
use_session: 1,
};
var url="//app.sealmetrics.com/tag/v2/tracker";function loadScript(callback){var script=document.createElement("script");script.src=url;script.async=true;script.onload=function(){if(typeof callback==="function"){callback();}};script.onerror=function(){console.error("Error loading script: "+url);};document.getElementsByTagName("head")[0].appendChild(script);}loadScript(function(){options.id=Math.floor((Math.random()*999)+1);if(window.sm){var instance=new window.sm(options);instance.track(options.event);}else{console.error("sm2 plugin is not available");}});
})();
}
</script>
Button Click Tracking
<button onclick="trackButtonClick('Download Brochure')">Download Brochure</button>
β
<script>
function trackButtonClick(buttonLabel) {
(function() {
var options = {
account: 'YOUR_ACCOUNT_ID_HERE',
event: 'download',
label: buttonLabel,
ignore_pageview: 1,
use_session: 1,
};
var url="//app.sealmetrics.com/tag/v2/tracker";function loadScript(callback){var script=document.createElement("script");script.src=url;script.async=true;script.onload=function(){if(typeof callback==="function"){callback();}};script.onerror=function(){console.error("Error loading script: "+url);};document.getElementsByTagName("head")[0].appendChild(script);}loadScript(function(){options.id=Math.floor((Math.random()*999)+1);if(window.sm){var instance=new window.sm(options);instance.track(options.event);}else{console.error("sm2 plugin is not available");}});
})();
}
</script>
Dynamic Event Tracking
// Function to track any custom event
function trackSealmetricsEvent(eventType, eventLabel, eventValue) {
(function() {
var options = {
account: 'YOUR_ACCOUNT_ID_HERE',
event: eventType,
label: eventLabel,
ignore_pageview: 1,
use_session: 1,
};
if (eventValue) {
options.value = eventValue;
}
var url="//app.sealmetrics.com/tag/v2/tracker";function loadScript(callback){var script=document.createElement("script");script.src=url;script.async=true;script.onload=function(){if(typeof callback==="function"){callback();}};script.onerror=function(){console.error("Error loading script: "+url);};document.getElementsByTagName("head")[0].appendChild(script);}loadScript(function(){options.id=Math.floor((Math.random()*999)+1);if(window.sm){var instance=new window.sm(options);instance.track(options.event);}else{console.error("sm2 plugin is not available");}});
})();
}
β
// Usage examples:
// trackSealmetricsEvent('microconversion', 'Newsletter Signup');
// trackSealmetricsEvent('purchase', 'Product Purchase', 149.99);
// trackSealmetricsEvent('custom', 'Video Watched');
Single Page Applications (SPA)
React Implementation
// React hook for Sealmetrics tracking
import { useEffect } from 'react';
β
const useSealmetrics = (accountId) => {
const trackPageview = () => {
(function() {
var options = {
account: accountId,
event: 'pageview',
use_session: 1,
};
var url="//app.sealmetrics.com/tag/v2/tracker";function loadScript(callback){var script=document.createElement("script");script.src=url;script.async=true;script.onload=function(){if(typeof callback==="function"){callback();}};script.onerror=function(){console.error("Error loading script: "+url);};document.getElementsByTagName("head")[0].appendChild(script);}loadScript(function(){options.id=Math.floor((Math.random()*999)+1);if(window.sm){var instance=new window.sm(options);instance.track(options.event);}else{console.error("sm2 plugin is not available");}});
})();
};
β
const trackEvent = (eventType, label, value) => {
(function() {
var options = {
account: accountId,
event: eventType,
label: label,
ignore_pageview: 1,
use_session: 1,
};
if (value) options.value = value;
var url="//app.sealmetrics.com/tag/v2/tracker";function loadScript(callback){var script=document.createElement("script");script.src=url;script.async=true;script.onload=function(){if(typeof callback==="function"){callback();}};script.onerror=function(){console.error("Error loading script: "+url);};document.getElementsByTagName("head")[0].appendChild(script);}loadScript(function(){options.id=Math.floor((Math.random()*999)+1);if(window.sm){var instance=new window.sm(options);instance.track(options.event);}else{console.error("sm2 plugin is not available");}});
})();
};
β
return { trackPageview, trackEvent };
};
β
// Component usage
const MyComponent = () => {
const { trackPageview, trackEvent } = useSealmetrics('YOUR_ACCOUNT_ID_HERE');
β
useEffect(() => {
trackPageview();
}, []);
β
const handleFormSubmit = () => {
trackEvent('microconversion', 'Contact Form');
};
β
return (
<form onSubmit={handleFormSubmit}>
{/* form content */}
</form>
);
};
Vue.js Implementation
// Vue.js mixin for Sealmetrics
const SealmetricsMixin = {
methods: {
trackSealmetricsPageview() {
(function() {
var options = {
account: 'YOUR_ACCOUNT_ID_HERE',
event: 'pageview',
use_session: 1,
};
var url="//app.sealmetrics.com/tag/v2/tracker";function loadScript(callback){var script=document.createElement("script");script.src=url;script.async=true;script.onload=function(){if(typeof callback==="function"){callback();}};script.onerror=function(){console.error("Error loading script: "+url);};document.getElementsByTagName("head")[0].appendChild(script);}loadScript(function(){options.id=Math.floor((Math.random()*999)+1);if(window.sm){var instance=new window.sm(options);instance.track(options.event);}else{console.error("sm2 plugin is not available");}});
})();
},
trackSealmetricsEvent(eventType, label, value) {
(function() {
var options = {
account: 'YOUR_ACCOUNT_ID_HERE',
event: eventType,
label: label,
ignore_pageview: 1,
use_session: 1,
};
if (value) options.value = value;
var url="//app.sealmetrics.com/tag/v2/tracker";function loadScript(callback){var script=document.createElement("script");script.src=url;script.async=true;script.onload=function(){if(typeof callback==="function"){callback();}};script.onerror=function(){console.error("Error loading script: "+url);};document.getElementsByTagName("head")[0].appendChild(script);}loadScript(function(){options.id=Math.floor((Math.random()*999)+1);if(window.sm){var instance=new window.sm(options);instance.track(options.event);}else{console.error("sm2 plugin is not available");}});
})();
}
}
}
Testing and Validation
Browser Console Testing
Open browser developer tools (F12)
Go to the Console tab
Visit a page with Sealmetrics installed
Look for successful loading messages
Check for any error messages
Real-Time Dashboard Verification
Install tracking code on a test page
Visit the page from different devices/browsers
Check Sealmetrics dashboard for real-time data
Verify events are being recorded correctly
Debug Mode
Add debug: 1
to your options for detailed console logging:
var options = {
account: 'YOUR_ACCOUNT_ID_HERE',
event: 'pageview',
use_session: 1,
debug: 1, // Enable debug mode
};
Troubleshooting
Common Issues
1. No Data Appearing
Verify Account ID is correct
Check for JavaScript errors in browser console
Ensure code is in the
<head>
sectionWait up to 10 minutes for data to appear
2. Events Not Tracking
Confirm
ignore_pageview: 1
is set for custom eventsCheck event is triggered properly (use console.log)
Verify event name is correct
3. Multiple Pageviews
Ensure only one pageview tracker per page
Check for duplicate installations
Use
ignore_pageview: 1
for event-only tracking
4. SPA Not Tracking Route Changes
Manually call tracking on route changes
Use framework-specific implementations above
Ensure pageview tracking on each route
Performance Optimization
Best Practices:
Place pageview tracking in
<head>
Use async loading (built into Sealmetrics code)
Minimize number of custom events per page
Test performance impact with browser dev tools
Security Considerations
Sealmetrics tracking is privacy-first by design
No personal data is collected
No cookies are used
GDPR compliant without consent requirements