Skip to content

EulerianTechnologies/eanalytics-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>;
}