Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@snowplow/tracker-core

Package Overview
Dependencies
Maintainers
3
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@snowplow/tracker-core

Core functionality for Snowplow JavaScript trackers

  • 3.9.0-beta.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
332K
increased by5.73%
Maintainers
3
Weekly downloads
 
Created

What is @snowplow/tracker-core?

@snowplow/tracker-core is a core library for Snowplow event tracking. It provides the essential functionalities to track events, manage contexts, and handle custom schemas. This package is typically used as a base for building more specific trackers for different platforms.

What are @snowplow/tracker-core's main functionalities?

Track Structured Events

This feature allows you to track structured events, which are events with a predefined set of properties such as category, action, label, property, and value.

const { trackerCore } = require('@snowplow/tracker-core');
const core = trackerCore('my-namespace', 'my-app-id');
core.trackStructEvent({
  category: 'category',
  action: 'action',
  label: 'label',
  property: 'property',
  value: 42
});

Track Unstructured Events

This feature allows you to track unstructured events, which are events with a custom schema. You can define your own schema and send data that conforms to it.

const { trackerCore } = require('@snowplow/tracker-core');
const core = trackerCore('my-namespace', 'my-app-id');
core.trackUnstructEvent({
  schema: 'iglu:com.acme/event/jsonschema/1-0-0',
  data: {
    key1: 'value1',
    key2: 'value2'
  }
});

Add Contexts

This feature allows you to add contexts to your events. Contexts provide additional information about the event, such as user details, session information, or any other relevant data.

const { trackerCore } = require('@snowplow/tracker-core');
const core = trackerCore('my-namespace', 'my-app-id');
const contexts = [
  {
    schema: 'iglu:com.acme/context/jsonschema/1-0-0',
    data: {
      key1: 'value1',
      key2: 'value2'
    }
  }
];
core.trackStructEvent({
  category: 'category',
  action: 'action',
  label: 'label',
  property: 'property',
  value: 42,
  context: contexts
});

Other packages similar to @snowplow/tracker-core

Keywords

FAQs

Package last updated on 17 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc