REMINDER
SOLVED Google Analytics and event tracking code
-
Dear AppDrag community,
I need to track some event on a website for one of my customer but I am not able to find where to add the information.
For example if some register to the newsletter form, the event is registered as :
Category : prospect
Action : inscrire
Label : newsletter
Value : 1I've seen that I should add this code to add on my website :
gtag('event', <action>, {
'event_category': <category>,
'event_label': <label>,
'value': <value>
});Which in my case will be :
gtag('event', 'inscrire', {
'event_category': 'prospect',
'event_label': 'newsletter',
'value': '1'
});Where do I add this information in order to track my event ?
Waiting your help,
Best regards,
-
Hey @nazem-samad, in the contact form settings, there is an option to add html code after the form is submitted, there you could add your script wrapped in script tags like this:
<script> gtag('event', 'inscrire', { 'event_category': 'prospect', 'event_label': 'newsletter', 'value': '1' }); </script>
-
Dear @Joseph-Benguira , thank you for your reply. I assume that if I need to track a link or a click on an element, I need to go to "Actions" then "Javascript" and add my code there.
Morevover, I did add the script on my website but my event is not reported on my Google Analytics account. The website is well linked to the account because I can see the traffic.
-
Well, I was too impatient everything is just fine with what you told me ! Thanks again for your precious help !