我正在使用纯模式
如何将下面的代码更改为AMP版本?
onclick="gtag('event','Click to call',{'event_category':'Call tracking','event_label':'Mobile header'});"
答案 0 :(得分:0)
<script type="application/json">
{
"vars": {
"gtag_id": "<GA_TRACKING_ID>",
"config": {
"<GA_TRACKING_ID>": {}
}
},
"triggers": {
"button": {
"selector": "#the-button",
"on": "click",
"vars": {
"event_name": "login",
"method": "Google",
"event_category": "Call tracking",
"event_label": "Mobile header"
}
}
}
}
</script>
文档:https://developers.google.com/analytics/devguides/collection/amp-analytics/#complete_example