Modern packaging to support the foundation for first-party web analytics
What is Beacon? • Play with the Beacon • Documentation • Install the Beacon • Contribute
In modern web experiences the collection of behavioral analytics is expected, but consumer trust in how that data is collected and shared is at an all time low.
Beacon is an open-source, privacy-first framework for collecting first-party web analytics. It provides a configurable, lightweight structure for capturing and organizing user interaction events without heavy third-party dependencies.
Beacon was created to help developers understand the architectural patterns behind web tracking and telemetry systems. While many commercial analytics solutions exist, Beacon is designed as an educational and foundational tool to demonstrate how event collection works, how data can be structured consistently, and how organizations can implement their own telemetry approaches with flexibility and transparency.
Rather than serving as a turnkey analytics platform, Beacon offers a modern, modular starting point for teams that want greater visibility into how web interaction data is defined, captured, and transmitted.
A stable framework of strongly typed code with highly testable components and minimal dependencies to provide a clear and stable developer experience and ability to extend as needed.
The output of this library is a single minified javascript file called beacon.js which can be installed into any web experience and further configured to collect web analytics events. You get the latest file from GitHub Pages or from the GitHub Releases folder.
Note: This experience has
beacon.jsinstalled and as an end-user will see log events in your browser, but you will also see that the delivery of these events is not enabled. Therefore - no data is collected from this experience or transported in any way.
If you want to go straight to playing with the Beacon, Click here to see an out of the box implementation. This page is an embedded iframe with a vanilla HTML page that has beacon.js installed as well as a simple log script to display the logs directly to you in the browser. You can click on elements on the page to see how the data is collected. As you load the page and interact with you, you will see all of the events that the beacon collects.
For many examples on how to install the script, including a more complex installation snippet, check out the detailed playground that shows the installation along with live logs to see how it all works
The simplest way to install the beacon is to use an inline installation script. This allows you to place a singular javascript file on your page and it'll take care of the rest.
<html>
<head>
// Place this script anywhere on your page (either in the head or before the end of the body)
<script type="text/javascript" id="beaconScript" async src="YOURURL/beacon.js" data-api-root="YOURURL"></script>
</head>- You will need to replace
YOURURLwith wherever you are sending the data, you omit this when you are just playing with the beacon. - This script helps simplify the installation you can further configure this installtion by adjusting
data-identityor defining trackers withdata-trackers.
Beacon is made available by Deloitte Consulting LLP under the terms of the Mozilla Public License 2.0. To the extent any intellectual property provided in connection with Beacon constitutes inventory within the meaning of section 471 of the Internal Revenue Code, such intellectual property is licensed to licensees by Deloitte Consulting LLP as agent for its product company subsidiary on the terms set forth above.
If you'd like to contribute, please read our guide to contributing