小编Ank*_*ain的帖子

“gatsby-plugin-google-analytics”不适用于我的 gatsby-strapi 网站

这是我在 gatsby-config.js 中的代码

module.exports = {
  siteMetadata: {
    title: `title`,
    description: ``,
    author: `@Wavii`,
  },

  plugins: [
    {
      resolve: `gatsby-plugin-google-analytics`,
      options: {
        trackingId: "UA-XXXXXX-XX",
        // Defines where to place the tracking script - `true` in the head and `false` in the body
        head: true,
      },
    },
    `gatsby-plugin-react-helmet`,
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `images`,
        path: `${__dirname}/src/images`,
      },
    },
Run Code Online (Sandbox Code Playgroud)

不知道为什么它不起作用,它甚至没有在我的源代码上显示任何谷歌分析。

提前致谢。

google-analytics gatsby

6
推荐指数
2
解决办法
2302
查看次数

标签 统计

gatsby ×1

google-analytics ×1