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

gdpr-tracking-client

v1.0.0

Published

A jQuery pluggin for GDPR-compliant interaction tracking

Downloads

2

Readme

GDPR Tracking Client

A GDPR-compliant tracking client, intended primarily for research projects as it currently only supports tracking vs no-tracking. Use together with the GDPR Tracking Server for an integrated solution.

Loading

Include the index.js into your JavaScript build process.

Configuration

The information about what information is tracked, what use it is put to, and the main tracking on/off switch must all be placed inside a HTML element with the attribute data-gdpr-tracking. The value of the attribute is sent to the server as an application identifier. The data-gdpr-tracking-url is the URL of the server to send the data to. The input element to handle the switch has to have the data-gdpr-tracking-switch attribute, and can either be a checkbox or an input element that allows a choice of values "true" or "false".

<div data-gdpr-tracking="your-tracking-id" data-gdpr-tracking-url="The URL to send tracking data to">
  <p>Explain to the user what is being tracked and what is done with the tracking
    information.</p>
  <p>
    <label>
      <input type="checkbox" name="tracking-switch" data-gdpr-tracking-switch=""/>
      Activate Tracking
    </label>
  </p>
</div>

The plugin loads automatically and if the user has previously made a selection, it automatically hides the tracking popup. The tracking on/off switch is stored in the browser's localStorage.

Show-hide the tracking information popup

When the user makes a choice regarding the tracking, it automatically hides the popup. It is possible to have additional elements that show or hide the tracking popup. These elements have to have an data-gdpr-tracking-ui-toggle attribute:

<a href="#" data-gdpr-tracking-ui-toggle="">Learn more about tracking</a>

Additional tracking switches

It is possible to have additional tracking switches that are outside the main tracking element. As with the main switch, these simply need the attribute data-gdpr-tracking-switch set. The plugin automatically ensures that all switches are kept in line with the stored information.

<label>
  <input type="checkbox" name="tracking-switch-2" data-gdpr-tracking-switch=""/>
  Tracking active
</label>

Tracking labels

In order to update the interface depending on whether the tracking is active or not, you can set the data-gdpr-tracking-label attribute on any element. If the tracking is active, then the plugin sets the "gdpr-tracking-active" CSS class on that element.

<body data-gdpr-tracking-label="">