mirror of
https://github.com/kremalicious/gatsby-plugin-matomo.git
synced 2024-12-22 17:23:23 +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) &&
|
||||
!isPathExcluded
|
||||
) {
|
||||
return (
|
||||
setHeadComponents([buildHead(pluginOptions)]) &&
|
||||
setPostBodyComponents([
|
||||
buildTrackingCode(pluginOptions),
|
||||
buildTrackingCodeNoJs(pluginOptions, pathname)
|
||||
])
|
||||
)
|
||||
setHeadComponents([buildHead(pluginOptions)])
|
||||
setPostBodyComponents([
|
||||
buildTrackingCode(pluginOptions),
|
||||
buildTrackingCodeNoJs(pluginOptions, pathname)
|
||||
])
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user