Поэтому я пытаюсь добавить плагин маркетинговой платформы Google на сайт gatsby и следую инструкциям по его применению в gatsbyconfig.js, но при попытке развернуть его выдает ошибку. Сам код плагина выглядит нормально, так как ошибок нет, но как только я пытаюсь развернуть его, он отображает «TypeError: {(промежуточное значение) (промежуточное значение)} не является функцией», вот изображение ошибки развертывания: https://imgur.com/5RapNj4.
Извините, если это было странно отформатировано, я действительно новичок в этом.
plugins: [
// Google marketing platform plugin
{
resolve: 'gatsby-plugin-google-marketing-platform',
options: {
dataLayer: {
// Preset dataLayer values
gaPropertyId: '[UA-148228240-1]',
},
tagmanager: {
id: '[GTM-M73LFW6]',
params: {
// GTM URL Parameters
// Ex: https://www.googletagmanager.com/gtm.js?id=[ID]>m_cookies_win=x
gtm_cookies_win: 'x'
}
},
analytics: {
id: '[UA-148228240-1]',
},
optimize: {
id: '[GTM-57N8BWZ]',
},
includeInDevelopment: true,
},
},
/*
* Sharp Image Processing
*/
`gatsby-plugin-sharp`,
`gatsby-transformer-sharp`,
/*
* Transform Markdown Files
*/
{
resolve: `gatsby-transformer-remark`,
options: {
// CommonMark mode (default: true)
commonmark: true,
// Footnotes mode (default: true)
footnotes: true,
// Pedantic mode (default: true)
pedantic: true,
// GitHub Flavored Markdown mode (default: true)
gfm: true,
// Plugins configs
plugins:
`gatsby-remark-relative-images`,
resolve: `gatsby-remark-images`,
options: {
maxWidth: 1080,
// linkImagesToOriginal: false,
linkImagesToOriginal: true,
tableOfContents: {
heading: null,
maxDepth: 2
}
}
},
resolve: 'gatsby-remark-copy-linked-files',
options: {
destinationDir: 'static'
}
}
],
excerpt_separator: `<!-- end of excerpt -->`
}
,
/*
* Access to Filesystem
*/
{
resolve: `gatsby-source-filesystem`,
options: {
name: `src`,
path: `${__dirname}/src`
}
},
/*
* Inline SVG Support
*/
{
resolve: `gatsby-plugin-react-svg`,
options: {
rule: {
include: /\.inline\.svg$/
}
}
},
/*
* SEO Metadata
*/
`gatsby-plugin-react-helmet`,
/*
* SASS
*/
`gatsby-plugin-sass`,
/*
* Styled Components
*/
`gatsby-plugin-styled-components`,
/*
* Google Analytics
*/
{
resolve: `gatsby-plugin-google-analytics`,
options: {
trackingId: process.env.UA-148228240-1,
// Puts tracking script in the head instead of the body
head: true,
// Setting this parameter is optional
anonymize: true,
// Setting this parameter is also optional
respectDNT: true,
// Avoids sending pageview hits from custom paths
// exclude: ["/preview/**", "/do-not-track/me/too/"],
// Enables Google Optimize using your container Id
optimizeId: process.env.GATSBY_GOOGLE_OPTIMIZE_ID,
// Any additional create only fields (optional)
sampleRate: 5,
siteSpeedSampleRate: 10,
cookieDomain: 'getroute.com',
// Setting this field to true will enables the parsing
// of cross-domain linker parmeters used to transfer state across domains. (optional)
allowLinker: true
}
},