AMP可以将Google跟踪代码管理器用于视频活动

时间:2018-10-09 12:46:13

标签: google-analytics google-tag-manager amp-html brightcove

是否可以为Google跟踪代码管理器使用视频(光明湾)触发器?

我应该在Google跟踪代码管理器上配置什么,以便在Google Analytics(分析)上发送视频播放事件(包括自动播放)。在Google跟踪代码管理器上,我找不到任何视频触发器。是否应该在没有Google跟踪代码管理器的情况下直接将事件发送给Google Analytics(分析)?

<amp-brightcove
                  data-account="906043040001"
                  data-video-id="1401169490001"
                  data-player-id="180a5658-8be8-4f33-8eba-d562ab41b40c"
                  layout="responsive" width="480" height="270">
</amp-brightcove>

amp视频分析页面:https://github.com/ampproject/amphtml/blob/master/extensions/amp-analytics/amp-video-analytics.md

amp-brightcove: https://ampbyexample.com/playground/#url=https%3A%2F%2Fampbyexample.com%2Fcomponents%2Famp-brightcove%2Fsource%2F

2 个答案:

答案 0 :(得分:0)

否,在AMP GTM中,您仅限于某些触发事件。除非您可以使用点击触发器。

答案 1 :(得分:0)

有一个Brightcove示例页面。 http://solutions.brightcove.com/bclifford/ampexamples/analytics.html

<amp-brightcove
  id="myPlayer"
  data-account="myAccountId"
  data-player-id="myPlayerId"
  data-embed="default"
  ...
>

<amp-analytics>
  <script type="application/json">
    {
      "requests": {
        "base": "https:/www.something.com/?",
        "pageview": {
          "baseUrl": "${base}type=pageview"
        },
        "event": {
          "baseUrl": "${base}type=event&name=${eventName}"
        }
      },
      "triggers": {
        "trackPageview": {
          "on": "visible",
          "request": "pageview"
        },
        "myVideoPlay": {
          "on": "video-play",
          "request": "event",
          "selector": "#myPlayer",
          "vars": {
            "eventName": "play"
          }
        },
        "myVideoEnded": {
          "on": "video-ended",
          "request": "event",
          "selector": "#myPlayer",
          "vars": {
            "eventName": "end"
          }
        },
        "myVideoSession": {
          "on": "video-session",
          "request": "event",
          "selector": "#myPlayer",
          "vars": {
            "eventName": "session"
          }
        }
      }
    }
  </script>
</amp-analytics>