Good day Team! I have to duplicate the question on...
# ask-questions
l
Good day Team! I have to duplicate the question once again: I encountered with a following problem: the company's website loads not immediately, but during 4-5 seconds (sometimes even more). The reason of that falls not within the scope of my issue. But it seems like it leads to the fact, that _experiment_viewed_ event is pushed to the datalayer only after Window Loaded event was pushed. Therefore, user almost always just browses to the next page before Window Loaded event was pushed and there is no _experiment_viewed_ at all. It is clearly illustrated on a screenshot below The SDK was connected via HTML tag + GTM, so the advice (https://docs.growthbook.io/faq#how-do-i-make-my-own-identifier) i already implemented. So to implement SDK, i added only one tag in GTM:
Copy code
<script>
  var script = document.createElement('script');
  script.async = true;
  script.setAttribute('data-api-host', '<https://api-gb.susp.io>');
  script.setAttribute('data-client-key', 'sdk-xxxx');
  script.src = "<https://cdn.jsdelivr.net/npm/@growthbook/growthbook/dist/bundles/auto.min.js>";
  document.getElementsByTagName('head')[0].appendChild(script);
</script>
Can anybody recommends anything to trigger event earlier please?
f
GTM takes a long time to load, so we recommend adding the GrowthBook script directly to the page's
<head>
instead for best performance.
l
Okey, i'm going to try it, thank you very much, Jeremy!