Some websites and web pages are built such that it may be useful to track different sections on a single page as separate â€œpage viewsâ€.
This is possible with Net-Results. Here is what is required:
- Ensure that the Net-Results Tracking Beacon is loaded on the site/page in question
Once youâ€™ve added the Net-Results Tracking Beacon to your website, it continually tracks every page view made by every visitor to your site (with the exception of visitors using certain ad blockers that interfere with marketing tracking beacons). The Tracking Beacon does this by sending data about each page view back to our servers.
The URL of each page viewed is simply text – something like â€œwww.yoursite.com/contactâ€. Net-Results records these page views and organizes them into â€œvisitsâ€. Page views and visits stream continually into the Net-Results platform from websites around the world.
If you have a web page divided into discrete sections and you would like to track each of those sections as if it were a separate page view, itâ€™s quite simple:
Call the $__MA.doCapture() function passing 3 parameters:
- The full URL of the â€œpageâ€ you would like tracked
- The â€œreferring URLâ€. You may choose to pass the URL of the site itself
- Your Net-Results â€œProduct IDâ€ which can be found in the upper right area of the My Account page in Net-Results
When setting this up, you can do so dynamically or static, or any combination of the two
Letâ€™s say you have a single web page with sections for â€œAboutâ€, â€œPricingâ€ and â€œContactâ€, and that youâ€™d like to record a page view in Net-Results each time one of these sections is viewed.
Here is how to record a static â€œpage viewâ€ for the Pricing section:
$__MA.doCapture(‘www.yourSite.com/Pricing, â€˜’www.yourSite.comâ€™, X);
(X represents your Net-Results Product ID).
Making this a bit more dynamic it may look something like this:
const productId = X;
const sectionName = Y;
$__MA.doCapture(document.location + sectionName, document.referrer, productId);
var sectionName = "/mySection"; $__MA.doCapture(document.location + sectionName, document.referrer, document.getElementById('__maSrc').getAttribute('data-pid'));
Importantly, Net-Results makes no attempt to validate that a particular URL actually exists. This means you may pass data on â€œpage viewsâ€ for web pages that do not exist: simply send a unique URL to Net-Results for each distinct section on your web page.