This message was deleted.
# ask-questions
w
This message was deleted.
f
Hi Darren - where do you see it pushing an array to the dataLayer?
p
Hi @fresh-football-47124 no worries, please go here and enter dataLayer into console https://www.addtoevent.co.uk/listings/confetti/west-yorkshire/leeds
Implementation
<script data-client-key="XXXXXXXXXXX" src="<https://cdn.jsdelivr.net/npm/@growthbook/growthbook/dist/bundles/auto.min.js>" async="async"></script>
Potentially this is the issue from auto.min.js
Copy code
// GA4 (gtag and GTM options)
      window.gtag ? window.gtag("event", "experiment_viewed", p) : window.dataLayer && window.dataLayer.push({
        event: "experiment_viewed",
        ...p
      });
It's assuming that if gtag is present that's used and array sent instead of object via google tag manager think panic
That could be clearer in documentation for newer users, but I think ideally that's a preference you should be able to set potentially.
As mentioned in my original message for now i've added and have had success adding this before my auto.min.js implementation:
Copy code
<script>
window.growthbook_config = window.growthbook_config || {};
window.growthbook_config.trackingCallback = (experiment, result) => {
          dataLayer.push({
            'event': 'experiment_viewed',
            'experiment_id': experiment.key,
            'variation_id': result.variationId
          });
};
</script>
My Ga4 configuration is implemented via a google tag if that helps
139 Views