Comments (5)
Hello uehler,
you accurately described one of the major hurdles when it comes to developing plugins for Shopware. The usual solution to this problem is to use the cache-breaking widget controllers. As you may know, I recently added a feature to add modules for custom dataLayers. I just released a new version that now supports widget controllers as custom modules.
In the following example we want to track the first name of the logged in customer. As a "carrier" for dataLayer push we will use the checkout/info
endpoint. First, make sure that the endpoint is not being cached. So possibly remove from widgets/checkout
controller from the cached controller list. Add a new module with the key widgets_checkout_info
. Afterwards you can go ahead and configure the dataLayer for the new module. To get an idea of the variables you can use within the dataLayer see the template of the endpoint under themes/Frontend/Bare/widgets/checkout/info.tpl
The dataLayer push for widget views will be prepended directly before the corresponding markup, so it possibly won't be part of the first push within the head
tag but will appear wherever the widget was inserted. I hope this helps.
I won't upload that new version the Shopware Community Store just now. It would help a lot if you would be willing to give this a try first and tell me if this version solved the issue.
from wbmtagmanager.
ok great, we will test it on monday and give you feedback
from wbmtagmanager.
Hi @dneustadt,
I just tested your changes and it looks good so far, but there are a lot of executions of the window.dataLayer.push on detail and listing (screen from detail)
In our custom theme its even worse.
I did the same steps like you and tested Shopware 5.2.27 with custom theme based on the bootstrap theme and Shopware 5.3.7 with default theme
from wbmtagmanager.
Thanks for the feedback. I just drafted a new release (still 3.2.0) that includes according changes. That should fix the issue with identical dataLayer tags being prepended on multiple Widget PostDispatch events.
from wbmtagmanager.
yes, that problem is fixed
thank you very much!
from wbmtagmanager.
Related Issues (20)
- Shopware: no purchase gets tracked for google analytics
- Subscriber Struktur HOT 2
- Move Code after meta charset? HOT 2
- Implement metod to add own scripts to the Resources/tags/head.html HOT 2
- Why Trigger DOM Ready HOT 1
- Matomo (Piwik) Tag Manager HOT 1
- Feature Request: IP Filter for internal traffic HOT 1
- Which smarty variable for add to cart HOT 1
- shopware 6 support HOT 5
- Google Ads Conversion Event HOT 1
- Deleting an article from the shopping cart does not cause a DataLayer push. HOT 1
- Not allowed by security setting HOT 4
- Datalayer gets cut off on the categories page because of too much products
- Shopware => 5.7.x HOT 2
- get the product category at purchase HOT 1
- TypeError (Cannot read property 'find' of undefined) in onProductClicked HOT 1
- Matomo Tag Manager HOT 1
- Add new GA4 Datalayer configuration HOT 2
- Sanitize product/category data
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wbmtagmanager.