npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@voicenter-team/lead-tracker

v0.9.35

Published

The Lead Tracker Library is a powerful tool for tracking and sharing lead data across multiple domains using a centralized API. It enables seamless capture and synchronization of query parameters and referrer URLs, making it easier to track and analyze

Downloads

2,358

Readme

Lead Tracker Library

The Lead Tracker Library is a powerful tool for tracking and sharing lead data across multiple domains using a centralized API. It enables seamless capture and synchronization of query parameters and referrer URLs, making it easier to track and analyze user behavior across your digital ecosystem.

Features

  • 🌐 Cross-Domain Data Sharing: Easily share lead data across multiple domains using a secure and efficient API-based communication mechanism.
  • 📝 Query Parameter Tracking: Automatically capture and store query parameters from the current URL, allowing you to track important lead information.
  • 🔄 Real-Time Synchronization: Keep lead data in sync across all domains in real-time, ensuring consistent and up-to-date information.
  • 🔒 Secure Communication: Utilize secure API endpoints to exchange data between domains, maintaining data integrity and privacy.
  • 🎛️ Customizable Configuration: Tailor the behavior of the Lead Tracker Library to your specific needs with customizable options such as API endpoints.
  • 📊 Easy Integration: Seamlessly integrate the library into your existing web applications with minimal setup and configuration.

Installation

To install the Lead Tracker Library, simply include the library file in your project:


<script src="https://mirrored-lead-tracker-cdn.pages.dev/lead-tracker.umd.js"></script>

Or, if you're using a module bundler, you can install it via npm:

npm install @voicenter-team/lead-tracker

Then, import the library in your JavaScript code:

import LeadTracker from '@voicenter-team/lead-tracker'

Usage

  1. Create a new instance of the LeadTracker class, passing in the necessary configuration options:
const leadTracker = new LeadTracker({
    leadTrackerModuleName: 'myLeadTracker',
    apiOptions: {
        setQueryApi: 'https://api.example.com/set-query',
        getAllQueryApi: 'https://api.example.com/get-all-query',
    },
    silent: false,
});
  1. Initialize the lead tracker by calling the init method:
leadTracker.init()
  1. The Lead Tracker Library will automatically capture query parameters from the current URL and send them to the specified API endpoint for storage.

  2. To access the stored query parameters, you can use the getQueryParams method:

const queryParams = leadTracker.getQueryParams()
console.log(queryParams)

Configuration Options

The LeadTracker constructor accepts an object with the following configuration options:

  • leadTrackerModuleName (required): The module name for the lead tracker. It will be used for logging and storage.
  • apiOptions (required): An object containing the API endpoints for setting and retrieving query parameters.
    • setQueryApi (required): The API endpoint for setting query parameters. This endpoint should accept a POST request with the query parameters in the request body.
    • getAllQueryApi (required): The API endpoint for retrieving all query parameters. This endpoint should return a JSON object with the query parameters.
  • silent (optional): If set to true, the library will not log any messages. Default is true.

API Endpoints

The Lead Tracker Library communicates with the following API endpoints:

  • Set Query API POST request to the specified setQueryApi endpoint with the following payload:
{
  "fingerprint": "visitor-fingerprint",
  "moduleName": "lead-tracker-module-name",
  "data": {
    "time": "timestamp",
    "referrerUrl": "referrer-url",
    "key1": "value1",
    "key2": "value2"
  }
}
  • Get All Query API POST request to the specified getAllQueryApi endpoint with the following payload:
{
  "fingerprint": "visitor-fingerprint",
  "moduleName": "lead-tracker-module-name"
}

The API should respond with the following data:

{
  "data": [
    {
      "time": "timestamp",
      "referrerUrl": "referrer-url",
      "key1": "value1",
      "key2": "value2"
    }
  ]
}

Contributing

Contributions to the Lead Tracker Library are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.

License

The Lead Tracker Library is open-source software licensed under the MIT license.