C
C
coolstudent2020-03-13 16:56:42
Google
coolstudent, 2020-03-13 16:56:42

How to properly set up a target in google and kick it from gtag.js?

The problem is the following - you need to set up a goal in Google and pull it when you call the popup on the site. I set up a goal in Google Analytics:
1 goal setting: custom template
2 goal description: name callback_form_click event type
3 goal details: category equals callback_form, action equals click.

In turn, the gtag script is connected on the site in this way:

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-156076612-1"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-156076612-1');//UA-129104230-1
</script>


Tracking ID UA-156076612-1 rechecked - it is correct.

When I click on the popup call, I execute the following code:
gtag('event', 'callback_form_click', {
// параметры событий
'event_category': 'callback_form',
'event_action': 'click',
// ...
});

At the same time, in debugging the browser, you can see that the request is leaving. the code runs fine, but in google analytics, this goal has a zero in the "conv for the last 7 days" column.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2020-03-13
@dimonchik2013

it helps to kick the same through measurement and look
better in a separate acc

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question