GrowthMetrics Pixel Implementation Guide
This guide shows you how to properly implement the RevMetrics tracking pixel on your website.
Important: Make sure to replace
YOUR_PIXEL_ID with your actual pixel ID in all code examples.Basic Implementation
Add the following code to the <head> section of your website:
<!-- GrowthMetrics Tracking Pixel -->
<script>
(function(w, d, s, p) {
w['GrowthMetricsPixel'] = w['GrowthMetricsPixel'] || function() {
(w['GrowthMetricsPixel'].q = w['GrowthMetricsPixel'].q || []).push(arguments)
};
// Load the pixel script
var js, fjs = d.getElementsByTagName(s)[0];
js = d.createElement(s);
js.async = 1;
js.src = 'https://pixel.growthmetrics.me/tracker.js';
fjs.parentNode.insertBefore(js, fjs);
// Initialize with your pixel ID
w['GrowthMetricsPixel']('init', 'YOUR_PIXEL_ID', {
debug: false
});
// Track page view automatically
w['GrowthMetricsPixel']('trackPageView');
})(window, document, 'script');
</script>
Debug Mode Implementation
For testing and troubleshooting, use this version with debug mode enabled:
<!-- GrowthMetrics Tracking Pixel (Debug Mode) -->
<script>
(function(w, d, s, p) {
w['GrowthMetricsPixel'] = w['GrowthMetricsPixel'] || function() {
(w['GrowthMetricsPixel'].q = w['GrowthMetricsPixel'].q || []).push(arguments)
};
// Load the pixel script
var js, fjs = d.getElementsByTagName(s)[0];
js = d.createElement(s);
js.async = 1;
js.src = 'https://pixel.growthmetrics.me/tracker.js';
fjs.parentNode.insertBefore(js, fjs);
// Initialize with your pixel ID and debug mode
w['GrowthMetricsPixel']('init', 'YOUR_PIXEL_ID', {
debug: true
});
// Track page view automatically
w['GrowthMetricsPixel']('trackPageView');
})(window, document, 'script');
</script>
Tracking Events
You can track different types of events using the RevMetricsPixel function:
Page Views
GrowthMetricsPixel('trackPageView', {
url: window.location.href,
title: document.title,
path: window.location.pathname
});
Conversions
GrowthMetricsPixel('trackConversion', {
value: 99.99,
currency: 'USD',
transactionId: 'ORDER-123456'
});
Leads
GrowthMetricsPixel('trackLead', {
formId: 'contact-form',
leadType: 'newsletter',
source: 'homepage'
});
Clicks
GrowthMetricsPixel('trackClick', {
elementId: 'cta-button',
elementText: 'Sign Up Now'
});
Common Issues & Troubleshooting
| Issue | Solution |
|---|---|
| No events showing up |
|
| CORS errors |
|
| Script loading errors |
|
| Events not showing in dashboard |
|
Pro Tip: Always test your pixel implementation with debug mode enabled first, then switch to production mode once everything is working correctly.