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 🙏

© 2025 – Pkg Stats / Ryan Hefner

nuxt-snapchat-tracker-module

v1.0.1

Published

A nuxt module allowing for snapchat tracker integration

Readme

npm version npm downloads License

nuxt-snapchat-tracker-module

A nuxt module for snapchat tracker integration

📖 Release Notes

Setup

  1. Add nuxt-snapchat-tracker-module dependency to your project
yarn add nuxt-snapchat-tracker-module # or npm install nuxt-snapchat-tracker-module --save
  1. Add nuxt-snapchat-tracker-module to the modules section of nuxt.config.js
{
  modules: [
    // Simple usage
    'nuxt-snapchat-tracker-module',

    // With options
    ['nuxt-snapchat-tracker-module', {
      track: 'PageView', // default
      id: '<YOUR TRACKING ID>', // mandatory
      disabled: false // default, but beware of GDPR
    }]
  ]
}

You can also put your options outside modules

{
  modules: [
    'nuxt-snapchat-tracker-module',
  ],
  snaptr: {
    track: 'PAGE_VIEW', // default
    id: '<YOUR TRACKING ID>', // mandatory
    disabled: false // default, but beware of GDPR
  }
}

All user informations are optionnals. Read more below

GDPR

You should collect consent before enabling the tracker to be compliant with GDPR.

First, disable snaptr in yoiur nuxt config file :

{
  modules: [
    'nuxt-snapchat-tracker-module',
  ],
  snaptr: {
    ...
    disabled: true // <-- change this
  }
}

Then, collect consent on a popin or whatever then call (in any VueJS component)

this.$snaptr.enable();

This will enable the tracker AND call a track event with the Event specified in options (defaut: PAGE_VIEW)

Please note that this module won't remember consent from one session to another. If you want to save the user preference, just hold the information on a local cookie and programatically call this.$snaptr.enable()

User informations

In attempt to better match the user browser, snapchat tracker allows you to provide an email or a phone number when initialising the tracker.

To init the tracker providing user informations, simply add them as an argument when enabling the tracker. You won't be able to pass some user information if you auto start the tracker as it wouldn't make any sense.

this.$snaptr.enable({
  user_email: '[email protected]'
})

Read more about the possible user informations here : https://businesshelp.snapchat.com/en-US/a/pixel-website-install

API

Options

| Option | Default | Required | Description | |----------|----------|----------|-------------------------------------------------------------------------------------------| | id | null | true | The unique tracker identifier provided by Snap. | | track | PAGE_VIEW | false | Default tracking event. | | disabled | false | false | Prevent the tracker to automatically initialize

Tracker instance

The tracker is available everywhere and allows you to call specific tracking event during navigation or on some user actions.

Access the tracker with this.$snaptr

| Method | Purpose | Args | |-------------------|----------------------------------------------------------------------------------------------------------|--------------------------------| | enable(user) | Initialize the pixel and tracks the current page view | user:Object: Snapchat user information (Optionnal, see above) | | init(user) | Initialises the tracker but do not track the current page | user:Object: Snapchat user information (Optionnal, see above) | | track(event, parameters) | Sends a track event with optional parameters. | event:String : defaults to track option if not specified.parameters:Object: Some object containing additional info such as purchase price. defaults to null. | | query(cmd, name, parameters) | Call the snaptr tracker directly. Only use case would be to call future commands yet not implemented in this module. | cmd:String: the snaptr command (ex: "track").value:String: The snaptr event name (ex: "PAGE_VIEW").parameters:Object: Optionnal snaptr parameters

License

MIT License

Copyright (c) Nicolas Chesné