react-ga4 icon indicating copy to clipboard operation
react-ga4 copied to clipboard

Ecommerce Plugin migration

Open bastian-hidalgo opened this issue 3 years ago • 0 comments

Hi, first of all, thanks for your job doing this package.

I would like to know of could I migrate the usage for 'ec' plugin from old reactGA.

For example:

ReactGA.plugin.require('ec');

const TRACKERS = [COMPANY_TRACKER, COMMERCE_TRACKER];

TRACKERS.forEach((tracker) => ReactGA.ga(`${tracker}.require`, 'ec'));

// Inside a foreach for products and trackers : 
...
ReactGA.plugin.execute(`${tracker}.ec`, 'addToCart', PRODUCT);
...
ReactGA.plugin.execute(`${tracker}.ec`, 'setAction', 'purchase', PURCHASE);

Thank you.

bastian-hidalgo avatar Aug 03 '22 16:08 bastian-hidalgo