A
A
Adel Khalitov2019-06-12 19:06:56
Angular
Adel Khalitov, 2019-06-12 19:06:56

How to track an event using angulartics2?

I'm trying to stick angulartics2 (for gtm) into the angular project, page tracking, web browser, etc. work on 5+, but I can't track the event. I do everything according to the instructions on the site.

this.angulartics2.eventTrack.next({
            action: 'send_form',
})

It does not send data, I check with ?_ym_debug=1, although loading the page with it gives results in the console "PageView. Counter 4962 ****" What could be the reason for this?
It is necessary to work exclusively with GTM.
Perhaps I do not understand the meaning of the parameters in this line:
this.angulartics2.eventTrack.next({ 
  action: 'myAction',
  properties: { 
    category: 'myCategory', 
    label: 'myLabel',
  },
});

I have created a tag with a custom event trigger, where the id is send_form , so maybe my code is not correct.
this.angulartics2.eventTrack.next({
            action: 'send_form',
})

How to make it work?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question