An open API service indexing awesome lists of open source software.

https://github.com/groupby/gb-tracker-client

JavaScript tracker client used to beacon events to GroupBy servers. Uses first-party cookies to anonymously track shoppers.
https://github.com/groupby/gb-tracker-client

analytics-tracking ecommerce javascript typescript

Last synced: 11 months ago
JSON representation

JavaScript tracker client used to beacon events to GroupBy servers. Uses first-party cookies to anonymously track shoppers.

Awesome Lists containing this project

README

          

# GroupBy Tracker Client

![Node.js CI badge](https://github.com/groupby/gb-tracker-client/actions/workflows/node.js.yml/badge.svg)
![CodeQL static code analytics badge](https://github.com/groupby/gb-tracker-client/actions/workflows/codeql-analysis.yml/badge.svg)

This is the JavaScript SDK used to send beacons to GroupBy. It can only run in the browser. A bundled UMD build is available from our CDN (see GroupBy docs for CDN link) and a CommonJS build is available for linking into NPM build processes with a bundler. E.g. React, Angular.

## Usage from CDN

Add the CDN `` to each page, above where the tracker is instantiated and used:

```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="http://cdn.groupbycloud.com/gb-tracker-client-<major_version>.min.js">

var tracker = new GbTracker('customer_id', 'area');
tracker.autoSetVisitor();

tracker.sendAddToCartEvent({ ... });