I have a challenge regarding the Stape Cookie Keeper for my Shopify website.
In Shopify I am using a custom pixel to insert the web gtm for all websites, the normal shop and the checkout pages.
In Stape I aready use the custom loader and therefore I got a new web gtm script. I exchanged the normal gtm web script with the new one from stape in my custom pixel and everything is working just fine. I see the network requests not as collect request anymore, but with the container identifier.
But when I try to include the Cookie Keeper, I get stuck.
In Shopify I installed the Stape GTM Server App, configured it as described by stape and I deleted the gtm script code from my custom Pixel, but the app is not inserting the gtm script. And so, I don’t see any network requests anymore.
When I just include the custom loeader, I can filter by the container identifier and I see requests. In this case, I still have my gtm code in the custom pixel. As soon as I remove this gtm code from the custom pixel and hope for the stape app to insert the script, I don’t see these requests any more. And after a while, I don’t se any users any more in my GA4 real time report.
If you are using Stape app, all you need to do is to tick the checkboxes, enter your data to the inputs and copy-paste the code from dataLayer tab to the custom pixel - thus custom loader will be loaded on all pages of the website, including checkout pages
I tried to paste the code in a new custom pixel as well, but still get the same error message. I pasted the code without the opening and cloded script phrases, so just the actual code as I did with the custom loader gtm script.
GTM loader with Cookie Keeper cannot work in custom web pixel due to sandboxed environment restrictions from Shopify and it will throw errors, there is actually no need to insert it there. The app inserts the loader with Cookie Keeper on all liquid pages, so it works there, but when it comes to the sandboxed environment on checkout - it loads custom loader without Cookie Keeper.
So if you are using Stape app - there is no need to put custom loader code anywhere - just copy-paste the one from the dataLayer tab and enter all the information on the general tab
But the problem is when I delete the custom loader gtm script from my custom pixel and put in all the general information in the stape app, the gtm is not inserted.
The domain is smartsleep.com. At the moment, I still use the custom loader gtm script in my custom pixel, because without I don’t have any tracking (since the gtm is not loading from the stape app). But at the same time I still have the activated stape app in place with the checkbox for “insert web GTM script”.
The Stape App is now enabled. Thank you so much for that tip! And in the Network Tab it seems as if the GTM is inserted, but the still no GA4 request. It seems as if the Stape App and my custom pixel are not working together because I have the datalayer code for all events like page_view, add_to_card, purchase and so in my this custom pixel.
You have GA4 adblock bypass enabled, so all GA4 requests are encoded, you may filter browser network by your Stape container identifier to see them.
I do see them on your website, so all should be good now and you should be able to see live traffic in your GA4 realtime
Yes, I know that they are encoded and I look for the container identifiyer to check the requests.
At the moment, I have the Custom Loader enabled and insert the new gtm through the Custom Loader code in my custom pixel. But I don’t use the new code for the Cookie Keeper at the moment.
When I delete the gtm code from my custom pixel and activate the Stape app in order to use the Cookie Keeper, I don’t see these requests any more and I don’t get any GA4 requests in my property. That’s why I don’t keep that activated, because I would loose a lot of traffic You see the setup for the Custom Loader and not the setup for the Cookie Keeper.
Now I can only see standard GTM loader on your website. Cookie Keeper cannot work in web pixel sandbox, so the GTM loader script should either be rendered in theme.liquid or inserted via Stape app
Yes, I know. I switched back to the old gtm code because I needed to test something and therefore I needed to see the entire network request information But I found the reason, now. In my custom pixel I have the information about the user’s consent decision which I applied with blocking trigger in GTM. But the Stape App is not able to see the datalayer information about the user’s consent decision.
Usually, GTM container is being loaded regardless of the consent decision, it is in the GTM where you control to fire tag or not based on the user’s consent preferences
Yes, exactly. But I insert the consent information logic in my custom pixel and I have the connected exclusion trigger in gtm. If I don’t use the consent blocker in GTM, the tags are firing.
Thank you so much for all your answers and the help! I really appriciate it!