1
0
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:
Julien Blatecky 2019-06-13 19:42:07 +02:00 committed by GitHub
parent 57092e5b0f
commit 12a34647b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
} }