add delayLoad + delayLoadTime option to improve performance on gatsby-plugin-google-tagmanager #27674
Replies: 3 comments
-
This sounds like a good idea where we'd welcome a PR. What do you reckon, @wardpeet? |
Beta Was this translation helpful? Give feedback.
-
For the record, two things:
|
Beta Was this translation helpful? Give feedback.
-
Great idea! The way we load google analytics etc isn't ideal. We shouldn't add it to the DOM by default. We should load it async in onClientEntry so we don't take any resources away from the device during loading. This article kinda explains the how and the why: I'm happy to explain this more deeply if it's unclear. |
Beta Was this translation helpful? Give feedback.
-
Request to implement a delayLoad features to improve performance.
As @Kilian pointed here:
@Kilian then shows a solution created by himself that solves this issue in
gatsby-plugin-segment-js
.On Gatsby plugin library there is some plugins with documentation links broken (
gatsby-plugin-google-tagmanager-delayed
,gatsby-plugin-google-tagmanager-timeout
) trying to implement this, but they dont seem to follow the proper steps to implement the functionality which are:My request is to implement this same functionality to
gatsby-plugin-google-tagmanager
.Beta Was this translation helpful? Give feedback.
All reactions