0
votes

I'm able get google analytics for routes, if we navigate different routes it is working but inside a page i have multiple tabs. i want tab based google analytics navigation. please refer below upload image for reference purpose. Thank You in advance

ga('create', 'UA-XXXXXX-Y', {'userId': customUserId}); // If "User ID" feature is available ga('require', 'displayfeatures'); ga('set', 'dimension1', customUserId); // Set a customUserId dimension at page level ga('send', 'pageview');enter image description here

1

1 Answers

1
votes

You have to capture custom event for this

//Function in service.ts file  
googleEventTrack(eventCategory,eventLabel,eventAction,eventValue) {
(<any>window).ga('send', 'event', {
  eventCategory: eventCategory,
  eventLabel: eventLabel,
  eventAction: eventAction,
  eventValue: eventValue
});

}

//capture event on button click in component.ts
btnClick(){
   this.CommonService.googleEventTrack('eventCategory', 'eventLabel',
   'eventAction', 'eventValue');
}