Net-Results Tracking Beacon

What You'll Learn

What The Net-Results Tracking Beacon Is

How The Tracking Beacon Works

How To Implement It On Your Website

Tracking Beacon overview

The Net-Results tracking beacon is very similar to the Google Analytics tracking beacon in both functionality and implementation. Both are small snippets of javascript that call a larger bit of javascript. This larger bit of javascript does all the work.

At a high level, the Net-Results tracking beacon…

    • Creates a Net-Results “Contact” for each visitor that arrives at your website
      • This Contact initially lacks a first name, the last name, an email address and all other personally-identifying information. This is known as an “Anonymous Contact”
    • Creates a “Visit” in Net-Results for that Contact. It stores the source of the website visit as well as duration and number of web pages viewed during the visit
    • Makes a record of each page view in that Visit such that you are able to see exactly which pages were viewed by any Contact during any Visit
    • Makes a record of whether your Contact viewed any YouTube, Wistia, or Vimeo videos that you have embedded on your website, as well as the percentage of the video that was watched
    • Makes a record of any PDF documents that the visitor may have clicked on while visiting your website
  • Aids in the display of any Net-Results Forms that you may choose to build within Net-Results and then embed the pages of your website

How does the Net-Results tracking beacon work?

The Net-Results tracking beacon issues a unique ID to each visitor. This unique ID is stored in a “1st party cookie”.

A cookie is a bit of text that web browsers like Google Chrome can store. Despite common misperceptions, cookies cannot discover your email address or other identifying information. A cookie is nothing more than a tiny text file. It has no special powers. In this case, we simply store the unique ID in this text file.

Being a 1st party cookie means that the Net-Results tracking beacon makes no attempt to monitor your website visitors once they have left your website. This is something that 3rd party cookies do. Net-Results does not utilize 3rd party cookies.

Whenever a page is viewed on your website, the Net-Results tracking beacon retrieves the unique ID from the cookie. It then sends data to our servers to be stored. The data sent to Net-Results in this process includes…

    • the visitor’s unique ID
    • the URL of the page that was visited
    • the date and time at which the page view occurred
    • the URL of the web page that led the visitor to the current page
  • the IP address reported by the visitor’s web browser

Each of these page views is now associated with the unique ID assigned to that visitor and to the Contact record that now exists in Net-Results. This is the mechanism that allows Net-Results to show you each visitor to your website, how they arrived at your website, and which web pages were viewed by that visitor and for how long.

Net-Results uses the IP address in an effort to discover the city, state/province, and country where your website visitor is located. It can sometimes tell us the name of the company where the visitor works.

If a website visitor, at some point during their visit or during any subsequent visit, submits a Net-Results Form embedded on your website, Net-Results will record the form submission (allowing you to trigger a number of automated actions) and update the Contact record for that visitor. Depending on the fields that your form required, your Contact’s first name, last name, and email address may be populated, for example. The Contact is no longer an “Anonymous Contact” but an “Identified Contact”.

What is the effect on the privacy of website visitors?

The vast majority of your website visitors will not submit a form on your website and will therefore remain anonymous and unidentified.

For those visitors that choose to submit a form, we recommend that you publish and update a privacy policy as needed in which you use plain language to disclose the data gathered and how that data will be used.

Hundreds of thousands of companies utilize technology similar to the Net-Results tracking beacon. In our experience, it’s commonly accepted businesses gather data on the usage of their website to improve marketing and communication efforts.

Implementing the Tracking Beacon

This snippet of code is a small block of javascript that needs inserted into the standard or “included” footer in your website. Companies with 2,000+ webpages have implemented this code in literally 5 minutes!

Where to find the code

  • Login to your Net-Results account.
  • Navigate to your “My Account” page by clicking on your email in the upper right hand corner of Net-Results.
  • At the upper right, you’ll find a section labeled “Your Implementation Code”.
  • When you hover your mouse over the implementation code, a small “copy” button will appear in the upper right hand corner. Click the button to copy your code.

Where to put the code

Good Question! The line of javascript must be placed within the <body> of each page. If your page employs a standard (or included) footer that’s part of each page (which is super common!), the code can be place just once into that included footer. Because the footer is apart of every page of your website, your implementation code is completed in minutes.

The ideal location to place the code is immediately above the tag at the end of the page, though this is not a requirement.

Check out this video to learn more!

The Technical Details

The Net-Results tracking beacon that you add to your website simply loads a larger bit of javascript from Amazon’s CloudFront content delivery network. The beacon determines whether your page was loaded via http or https, and then loads a file called capture.js from the CDN via the protocol that was used by your website visitor to load your page.

Detecting Whether the Tracking Beacon Has Loaded

When the capture.js file finishes loading, a javascript object named “$__MA” will be present in the page. You may test for its presence like this:

if (window.$__MA !== undefined) { … }

Getting the mauuid (Net-Results Unique Visitor ID)

The $__MA javascript object exposes several methods. One of these methods enables you to retrieve the mauuid which may be the starting point of various API operations.

const mauuId = ($__MA.getVisitorId().v);

A Note of Caution on Timing in Javascript

Javascript does not guarantee that any object will load in a certain order or within a given amount of time. The loading of the Net-Results tracking beacon is subject to DNS lookups, connection latency, the variable nature of the devices loading it (phones, laptops, desktops), the amount and nature of other javascript that may be loading or executing simultaneously…

As such, if writing code that depends on the Net-Results mauuid being present, it is a best practice to leverage javascript’s setInterval() method to “wait” until the $__MA object has finished loading before attempting to perform any operations that depend on its presence…

<script>
let i = 0;
const id = setInterval(function () {
if (window.$__MA !== undefined) {
clearInterval(id);
const mauuId = ($__MA.getVisitorId().v);
});
} else {
i++;
}
if (i === 10) {
clearInterval(id);
console.log('no mauuid, bailing');
}
}, 30)
</script>

Leveraging the Net-Results API

When you have the mauuid for a visitor, you may use it retrieve Net-Results’ unique contact_id associated with that visitor via the Contact::getContactIdByMauuid() API method.

The Net-Results contact_id is the key to retrieving data via the Net-Results API.

Note that any Net-Results Contact may be associated with more than one mauuid as any given mauuid is specific to a particular device and browser, given that they are stored in 1st party cookies.

Was this article helpful?

Related Articles