0.4.1 • Published 9 months ago

@polar-analytics/pixel-sdk v0.4.1

Weekly downloads
-
License
MIT
Repository
-
Last release
9 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

9 months ago

0.4.0

9 months ago

0.3.3

9 months ago

0.3.2

9 months ago

0.3.1

9 months ago

0.3.0

9 months ago

0.2.9

9 months ago

0.2.8

9 months ago

0.2.7

9 months ago

0.2.5

9 months ago

0.2.4

9 months ago

0.2.3

9 months ago

0.2.2

9 months ago

0.2.1

9 months ago

0.2.0

10 months ago

0.1.0

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago