<body>
...
<amp-analytics type="vponanalytics" id="vponanalytics">
<script type="application/json">
{
"vars": {
"licence_key": "XXXXXXXXXXXX",
"category": "web"
},
...
}
</script>
</amp-analytics>
...
</body>
<body>
...
<amp-analytics type="vponanalytics" id="vponanalytics">
<script type="application/json">
{
"vars": {
...
},
"triggers": {
"trackPageview": {
"on": "visible",
"request": "event",
"vars": {
"ev_name": "page_view",
"payload": "{\"title\":\"${title}\",\"current\":\"${canonicalUrl}\",\"previous\":\"${documentReferrer}\"}"
}
}
}
}
</script>
</amp-analytics>
...
</body>
<body>
...
<amp-analytics type="vponanalytics" id="vponanalytics">
<script type="application/json">
{
"vars": {
...
},
"triggers": {
"custom_event": {
"on": "click",
"selector": ".vp_search",
"request": "event",
"vars": {
"ev_name": "element_interact",
"payload": "{\"name\":\"${category}\",\"action\":\"search\",\"value\":\"{\"keyword\": \"搜尋關鍵字\",\"first_id\": \"會員id\"}\"}"
}
}
}
}
</script>
</amp-analytics>
...
</body>
<body>
...
<amp-analytics type="vponanalytics" id="vponanalytics">
<script type="application/json">
{
"vars": {
...
},
"triggers": {
"element_Interact": {
"on": "click",
"selector": ".vp_track_0",
"request": "elementInteract",
"vars": {
"action": "click",
"label": "ev_0_search-flight"
}
}
}
}
</script>
</amp-analytics>
...
</body>