These are chat archives for reactioncommerce/reaction

31st
Oct 2018
Abhishek
@thegtagamer
Oct 31 2018 13:37
after the removal of analytics from RC in v1.8 ..Is there any new addition for analytics implementation..?
Patrick Newell
@pnewell4_twitter
Oct 31 2018 13:39
@thegtagamer I added react-ga to my "theme" plugin and have been happy with it so far
ReactGA.initialize(TRACKING_ID);

// on page load & transition
Router.Hooks.onEnter(() => {
  ReactGA.pageview(window.location.pathname + window.location.search);

  const shop = Reaction.getShop();
  ReactGA.set({
    dimension1: shop ? shop.name : "Unknown Shop"
  });
});

// update userId on login
Accounts.onLogin(() => {
  ReactGA.set({ userId: Meteor.userId() });
});
I would recommend finding a list of Hooks (maybe scanning the code for them) to find all of the events which you should log
Abhishek
@thegtagamer
Oct 31 2018 13:40
@pnewell4_twitter Thanks man!!