问题
Hi everyone I am trying to track a form on an AMP website. I have already tried to track the visibility of the success message via GTM and is not working apparently form the documentation the event tracking on AMP is done by this
<amp-analytics type="gtag" data-credentials="include">
<script type="application/json">
{
"vars": {
"gtag_id": "<GA_TRACKING_ID>",
"config": {
"<GA_TRACKING_ID>": { "groups": "default" }
}
},
"triggers": {
"button": {
"selector": "#the-button",
"on": "click",
"vars": {
"event_name": "login",
"method": "Google"
}
}
}
}
</script>
</amp-analytics>
I have tried to use it in this way:
<amp-analytics type="gtag" data-credentials="include">
<script type="application/json">
{
"vars": {
"gtag_id": "UA-48872168-2",
"config": {
"UA-48872168-2": { "groups": "default" }
}
},
"triggers": {
"form": {
"selector": "#contact-form",
"on": "submit-sucess",
"vars": {
"event_name": "CATEGORIA",
"method": "AZIONE"
}
}
}
}
</script>
</amp-analytics>
and is not tracking: any ideas? Thank you in advance
来源:https://stackoverflow.com/questions/53780880/amp-analytics-form-submission-tracking