0.4.1 • Published 10 months ago

@polar-analytics/pixel-sdk v0.4.1

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

Pixel SDK

A lightweight JavaScript utility for reporting user touchpoints, similar to the Polar Analytics Pixel.

Installation

npm install @polar-analytics/pixel-sdk

Example usage

const payloadBase = await generatePayloadBase({
  customer: {
    // Optional, include if available
    id: "some-id",
    email: "some-email",
  },
});

// An anonymous ID to identify the device + browser 
// Please refer to https://community.shopify.com/c/shopify-apps/web-pixel-clientid/m-p/2664271/highlight/true#M80886
const shopifyClientId = 

// <the url of the shopify store> i.e. something.myshopify.com
const shopifyShopUrl =

// Use the corresponding eventFactory for the desired event type.
const data = eventFactory.cart_viewed({
    shopifyEventId: crypto.randomUUID(),
    shopifyClientId,
    shopifyShopUrl,
})

sendPixelEvent(
  pixelEndpoint /* obtained from polar analytics */,
  payloadBase,
  { data },
);
0.4.1

10 months ago

0.4.0

10 months ago

0.3.3

10 months ago

0.3.2

10 months ago

0.3.1

10 months ago

0.3.0

10 months ago

0.2.9

10 months ago

0.2.8

10 months ago

0.2.7

10 months ago

0.2.5

10 months ago

0.2.4

10 months ago

0.2.3

10 months ago

0.2.2

10 months ago

0.2.1

10 months ago

0.2.0

11 months ago

0.1.0

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago