1.0.32 • Published 1 year ago

@bilyai/js v1.0.32

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Official Bily SDK for Browser

npm version npm dm npm dt

Don't already have an account and store added ? Head over to Bily, then return to this page.

☕ Install package

npm install @bilyai/js
yarn add @bilyai/js

🚦 Configurations

Configuration should happen as early as possible in your application's lifecycle.

import { init } from '@bilyai/js';

init('https://b.magnetor.net');

Once implemented, Bily's JavaScript SDK will automatically track all pageviews. You can now begin tracking all other events as well.

🚀 Start tracking events

import { track } from '@bilyai/js';

track('Product Viewed', {
  client: {
    firstname: 'John',
    lastname: 'Doe',
    // ... other attributes here
  },
  products: [
    {
      id: '123',
      name: 'Product 1',
      price: 100,
      quantity: 1,
      currency: 'USD',
      sku: '123',
      category: 'Category 1',
      brand: 'Brand 1',
    },
  ],
  // ...other attributes here
});
import { track } from '@bilyai/js';

track('Product Added', {
  client: {
    firstname: 'John',
    lastname: 'Doe',
    // ... other attributes here
  },
  products: [
    {
      id: '123',
      name: 'Product 1',
      price: 100,
      quantity: 1,
      currency: 'USD',
      sku: '123',
      category: 'Category 1',
      brand: 'Brand 1',
    },
  ],
  // ...other attributes here
});
import { track } from '@bilyai/js';

track('Checkout Started', {
  client: {
    firstname: 'John',
    lastname: 'Doe',
    email: 'john@doe.com',
    // ... other attributes here
  },
  products: [
    {
      id: '123',
      name: 'Product 1',
      price: 100,
      quantity: 1,
      currency: 'USD',
      sku: '123',
      category: 'Category 1',
      brand: 'Brand 1',
    },
  ],
  // ...other attributes here
});
import { track } from '@bilyai/js';

track('Order Completed', {
  client: {
    firstname: 'John',
    lastname: 'Doe',
    email: 'john@doe.com',
    phone: '1234567890',
    gender: 'male',
    dateOfBirth: '1990-01-01',
    address: {
      city: 'New York',
      state: 'NY',
      country: 'US',
      zip: '10002',
    },
    // ... other attributes here
  },
  order: {
    id: '123',
    currency: 'USD',
    total: 100,
    products: [
      {
        id: '123',
        name: 'Product 1',
        price: 100,
        quantity: 1,
        currency: 'USD',
        sku: '123',
        category: 'Category 1',
        brand: 'Brand 1',
      },
    ],
  },
  // ...other attributes here
});

If you get stuck, shoot us an email or use the Intercom widget on the bottom right of any page.

We're excited you're here! :blue-heart:

This won't be fun to clean up...

1.0.32

1 year ago

1.0.31

1 year ago

1.0.29

1 year ago

1.0.30

1 year ago

1.0.28

1 year ago

1.0.27

1 year ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago