Hi
I would to add a gtag.js event for Google conversion tracking (see the article: https://developers.google.com/analytics/devguides/collection/gtagjs/events ) in the form where a user will download a file after submit the form.
If I'm not wrong I should insert the code in "On Sublmit" section before "File Download" action (see the image below). Could you confirm?
The code I have to insert is a Java Script and Custom code seems to support PHP not Java Script. How can I do it?
Hope you can help me soon
Thanks
Giulia
I would to add a gtag.js event for Google conversion tracking (see the article: https://developers.google.com/analytics/devguides/collection/gtagjs/events ) in the form where a user will download a file after submit the form.
If I'm not wrong I should insert the code in "On Sublmit" section before "File Download" action (see the image below). Could you confirm?
The code I have to insert is a Java Script and Custom code seems to support PHP not Java Script. How can I do it?
Hope you can help me soon
Thanks
Giulia

Hi Giulia,
You just add <script src="address of file"></script> to a custom code action on the page where you want the file to load
You just add <script src="address of file"></script> to a custom code action on the page where you want the file to load
Hi Max
so I have to create before a js file with my code and then I should insert the cusom code as you specified. Is it correct?
so I have to create before a js file with my code and then I should insert the cusom code as you specified. Is it correct?
no, use the address of file provided by Google
Hi Max
maybe there is a misundarstanding: the google page I inserted in the post is the example og Google Guide how to implement the code of event tracking
I need to insert a code like this:
How I can insert this code?
Custom action allows only php or html not javascript
maybe there is a misundarstanding: the google page I inserted in the post is the example og Google Guide how to implement the code of event tracking
I need to insert a code like this:
gtag('event', <action>, { 'event_category': <category>, 'event_label': <label>, 'value': <value>});
How I can insert this code?
Custom action allows only php or html not javascript
You can insert the code using a Load JavasScript action, but this code you posted should be changed according to your page data!
Yes I know I have to customize it.
I put following code il Load Javascript before the download pdf action, but I'm not sure if I have to leave the tag <script> ....</script>. Could you confirm?
<script>
gtag('event', 'download', {
'event_category': 'file-pms',
'event_label': 'wp'
});
</script>
I put following code il Load Javascript before the download pdf action, but I'm not sure if I have to leave the tag <script> ....</script>. Could you confirm?
<script>
gtag('event', 'download', {
'event_category': 'file-pms',
'event_label': 'wp'
});
</script>
yes, remove the <script> </script> tags
You need to login to be able to post a reply.