0

我已经按照这里的步骤https://amp.dev/documentation/examples/advertising-analytics/tracking_core_web_vitals/

这就是最终代码的样子

<amp-analytics>
  <script type="application/json">
  {
    "vars": {
       "gtag_id": "UA-XXXXXXXXX-X",
       "config": {
         "UA-XXXXXXXXX-X": {
            "groups": "default"
         }
       }
    },
    "triggers": {
      "default pageview": {
        "on": "visible",
        "request": "pageview",
        "vars": {
          "title": "{{title}}"
        },
        "extraUrlParams": {
          "lcp": "${largestContentfulPaint}",
          "cls": "${cumulativeLayoutShift}",
          "fid": "${firstInputDelay}",
          "cd1": "${ampdocHost}"
        }
      }
    }
  }
  </script>
</amp-analytics>

我创建了一个自定义维度以ampdocHost在 Google Analytics 中查看 并且运行良好,但我不知道如何查看和lcp,我什至不知道我是否在 Google Analytics 中收到了这个。clsfid

几天前文档已经更改,这是这些更改的提交https://github.com/ampproject/amp.dev/commit/29d3c5988aa4cc67a034bf0285b16b30483b56a2#diff-93413765a2017feb5c676bd79d5b4e041e99be8c04792805cc3a311a但现在我更困惑了。

我需要帮助来弄清楚如何lcp, cls, fid在 Google Analytics 中接收。

4

0 回答 0