mirror of
https://github.com/kremalicious/gatsby-plugin-matomo.git
synced 2024-12-23 01:29:42 +01:00
Fix missing tracking code in rendered HTML
`onRenderBody` does take any return type, I removed the useless `return null` at the end of this function. `setHeadComponents` doesn't return anything so the right side of the `&&` wasn't executed, only the `head` was built.
This commit is contained in:
parent
57092e5b0f
commit
12a34647b9
@ -85,13 +85,10 @@ exports.onRenderBody = (
|
|||||||
(process.env.NODE_ENV === 'production' || pluginOptions.dev === true) &&
|
(process.env.NODE_ENV === 'production' || pluginOptions.dev === true) &&
|
||||||
!isPathExcluded
|
!isPathExcluded
|
||||||
) {
|
) {
|
||||||
return (
|
setHeadComponents([buildHead(pluginOptions)])
|
||||||
setHeadComponents([buildHead(pluginOptions)]) &&
|
setPostBodyComponents([
|
||||||
setPostBodyComponents([
|
buildTrackingCode(pluginOptions),
|
||||||
buildTrackingCode(pluginOptions),
|
buildTrackingCodeNoJs(pluginOptions, pathname)
|
||||||
buildTrackingCodeNoJs(pluginOptions, pathname)
|
])
|
||||||
])
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
return null
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user