eanalytics-react

Eulerian Technologies Analytics javascript library

Usage no npm install needed!

<script type="module">
  import eanalyticsReact from 'https://cdn.skypack.dev/eanalytics-react';
</script>

README

Eulerian Analytics

Installation

npm install eanalytics-react --save

Usage

import React from "react";
import EAnalytics from "eanalytics-react";

EAnalytics.initialize("domain.client.tld");

Track events

import React from "react";
import EAnalytics from "eanalytics-react";

function AddToCartButton() {
  const handleClick = (e) => {
    e.preventDefault();
    EAnalytics.track([
      "uid",
      "73467",
      "prdref",
      "C4356",
      "prdname",
      "Veste_cuir_marqueA",
    ]);
    // ...
  };

  return <button onClick={handleClick}>Add to cart</button>;
}