Hello has anyone setup shopify with growthbook whi...
# ask-questions
f
Hello has anyone setup shopify with growthbook while using a custom pixel? For some reason I can't seem to get experiment_viewed to fire. Any help would be appreciated. I've tried the shopify SDK, the script SDK, I've tried sending the experiement_viewed trigger from multiple different places (It is firing from one in the datalayer but doesn't seem to be firing the event in GTM - Thinking it might be too early) any help would be appreciated.
s
Hey there! Couple things to check: 1. Is the event really in
dataLayer
? If you open GTM preview mode and go to the Shopify page, do you see the
experiment_viewed
event? 2. Is GTM configured to listen to
experiment_viewed
? GTM won't send to. GA4 unless this is setup. We have more details in the docs. 3. Your too early suspicion might be right, too. Are you able to try loading GrowthBook directly in the page
head
instead of through GTM? Again, you can use the GTM preview to help visualize everything is loading as expected 4. Which SDK are you using? I'm guessing the HTML script tag, is that right? 5. Can you confirm that the user id is being set correctly? Also, if you share how you're initializing GrowthBook, that'll be helpful, too.
f
I actually think I got it working but just to add some context to your question - When using a custom pixel in shopify preview mode doesn't work correctly making it a pain to debug. That said I was using another debugging tool and it looks like the experiment_viewed event is now firing when I added it to my custom pixel. I've been trying a lot of things so not sure where my Growthbook script is right now might be in both for all I know at this moment but will adjust once I get past the experiement viewed part. As far as the SDK I had gone back and forth between the script and the shopify one but I believe the shopify one really only works well if you are using the Google App in shopify for Analytics so I ended up having to abandon that after reading that in the documentation
👍 1