npm install eanalytics-react --save
import React from "react";
import EAnalytics from "eanalytics-react";
EAnalytics.initialize("domain.client.tld");
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>;
}