AMP analytics form -submission tracking

做~自己de王妃 提交于 2019-12-11 04:16:25

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!