Skip to content

dataLayer Explorer is designed to simplify the analysis of a site's dataLayer for developers and digital marketers.

License

Notifications You must be signed in to change notification settings

softwarespot/dataLayer-explorer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dataLayer Explorer

Extension logo

dataLayer Explorer is a powerful Chrome extension designed to simplify the analysis of a site's dataLayer for developers and digital marketers. This tool provides real-time insights into dataLayer events, enabling users to effortlessly monitor and inspect event data for informed decision-making.

Extension screenshot

Features

  • Access detailed data effortlessly. View a comprehensive list of events, each expandable to reveal rich, detailed information. The intuitive interface allows for quick navigation through events, ensuring important insights are easily accessible.
  • Identify GA4 events quickly. A visual indicator helps distinguish Google Analytics 4 (GA4) events, making it simpler to focus on relevant data.
  • Facilitate sharing. The "Copy" function enables easy copying of event details to the clipboard for quick access or sharing with team members, streamlining collaboration.
  • Analyze event timing precisely. Gain insights into the time elapsed between page load and each event push by simply hovering over the event name. This feature enables detailed analysis of event timing, contributing to a deeper understanding of site performance and user experience. Such precise timing information can be invaluable for optimizing page load sequences and improving overall site responsiveness.
  • Stay updated with ease. The extension features a refresh button that allows users to update the events list manually, ensuring access to the latest data whenever needed.
  • Open Source advantage. This extension is open source, allowing users to benefit from community-driven development and transparency. By being open source, it ensures that anyone can contribute to its improvement, fostering innovation and responsiveness to user needs.

Installation

Development

This extension is built with simplicity and transparency in mind. The source code is written in vanilla JavaScript and utilizes Chrome APIs directly, without the use of bundlers or frameworks. This approach ensures that the code you see in the repository is identical to what is deployed to the Chrome Web Store, facilitating easier review, modification, and understanding of the extension's functionality.

  • background.js: Serves as the extension's service worker, responsible for updating the browser icon based on the presence of the dataLayer for the currently viewed site.
  • popup.html / popup.js: Provides the user interface for debugging and interacting with the dataLayer.
  • contentScript.js: Facilitates communication between background.js and popup.html, detecting when the dataLayer is present and relaying the events pushed to it.
  • init.js: Loaded by contentScript.js, this script captures dataLayer events and sends them back to contentScript.js. This is necessary because contentScript.js lacks direct access to the window object and relies on these events when requested by popup.html.

Setup

Install the extension from the ./src directory as an unpacked extension by following the instructions outlined in this guide.

popup.html / popup.js

The extension provides a streamlined development process for the popup interface by utilizing a development server. When the ENVIRONMENT constant is set to development (which is done by the server), this setup allows developers to work without relying on Chrome APIs and instead uses simulated event data in place of actual dataLayer events. This approach enables efficient testing and iteration without the need to constantly close and reopen the extension.

Setup

  1. Install the supported Node.js version using nvm.
nvm install
  1. Install dependencies.
npm install
  1. Start the development server.
npm run start
  1. Navigate to http://localhost:8100.

  2. Start editing popup.html / popup.js in the ./src directory.

Contributing

If you encounter a bug while using the extension, please file an issue to report it. Suggestions for improvements are also welcome—feel free to submit an issue outlining your ideas. Additionally, if you'd like to contribute directly, you can provide enhancements through a merge request.

Your contributions help improve the extension and benefit the entire community.

Acknowledgements

License

The code has been licensed under the MIT license.

About

dataLayer Explorer is designed to simplify the analysis of a site's dataLayer for developers and digital marketers.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published