Giter VIP home page Giter VIP logo

wbmtagmanager's Introduction

WbmTagManager - GTM integration and dataLayer configuration

Scrutinizer Travis CI

This plugin integrates a new module within the Shopware backend that allows for the integration of the Google Tag Manager Snippet and the configuration of the dataLayer content.

WbmTagManager

The plugin offers the following features:

  • Prepend the GTM Snippet to the head Tag of every page
  • Define the content of the dataLayer for any combination of Module/Controller/Action
  • All variables passed to the view are available as values for the dataLayer properties
  • Use smarty syntax to insert variables and alter values

Requirements

  • Shopware >= 5.6.3

Installation

Clone this repository into a folder WbmTagManager within the custom/plugins directory of the Shopware installation.

  • Install the plugin through the Plugin-Manager within the Shopware backend.
  • Enter the container ID of the desired GTM Container (found in the GTM backend)
  • Activate the plugin and when prompted allow for the clearing of the listed caches.
  • Reload the backend to complete the installation.

Install with composer

  • Change to your root Installation of shopware
  • Run command composer require webmatch/wbm-tag-manager and install and activate plugin with Plugin Manager

Usage

The module will be accessible in backend through a new menu point under the Settings menu tab.

The plugin comes pre-configured for:

  • Enhanced Ecommerce Tracking of Google Analytics
  • Dynamic Remarketing of Google AdWords

Use syntax like "$sArticles as $sArticle" as value for properties that are supposed to contain iterative elements.

Adding modules

Modules are essentially configurations of a dataLayer for a specific view, meaning sites of more or less the same type.

Since version 3.0.0 there's a new UI for adding new modules, as well as updating and deleting existing modules.

When adding new modules you're prompted to enter a name (what the new tab will read) and a key for the module.

The key must contain the values for module, controller and action, connected by underscores. See the Shopware documentation for a more detailed explanation. The key must also be all lowercase.

After adding a module you will find a new tab in the main window, where you can declare the properties for the dataLayer of that specific view.

Additional Smarty functions

{dbquery}

Since version 3.0.0 a new Smarty function {dbquery} is available for the compiling of dataLayers. The function allows you to fetch a single value from any database table. You can pass one or multiple criterias to be used in WHERE and ORDER BY statements.

The following example will work in the dataLayer of the "Add to basket" module and will fetch the price of the newly added product.

{dbquery select='price' from='s_order_basket' where=['ordernumber =' => $smarty.request.sAdd, 'sessionID =' => $smarty.session.Shopware.sessionId] order=['id' => 'DESC']}

Please note the use of single quotes only and the array arguments.

Also be aware that this feature is reliant on proper syntax, meaning you have to pass an operator with the column name and the columns as well as the values have to exist. Syntax errors will be caught and will result in an empty string to be returned instead.

{request_get}

Request parameters won't be available utilizing $smarty.request if they have been set during dispatch or through sluggified URLs (e.g. /detail/index/sArticle/123). By using request_get and the param argument you can get any parameter available at the time of the dataLayer compiling.

{request_get param='sDelete'}

{*|to_string}

The modifier to_string will force casting of a value to string. The default behaviour is to try and determine the type of a value by json decoding. If a numeric value should still be recognized as a string, use the modifier after the variable or value. If you're chaining multiple modifiers, make sure to always use to_string in last place.

{123|to_string}
=>
"123"

Tracking URL Parameters

To track URL parameters (e.g. for campaigns) throughout the user journey, you can set up parameters that will be temporary saved in the session for use in the dataLayer configuration. Within the plugin configuration you can define a comma separated list of GET parameters (e.g. utm_campaign, gclid, etc). Those parameters can then be used in the dataLayer configuration by reading the session: {$smarty.session.Shopware.wbmTagManager.nameOfTheParameter}

wbmtagmanager's People

Contributors

akkushopjk avatar cjost1988 avatar dneustadt avatar gugiman avatar hlohaus avatar janbrockmann avatar mfusswm avatar nicoanders avatar uehler avatar wbm-mkopp avatar wbm-sbasler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wbmtagmanager's Issues

Smarty Debug not Working

After installing, activating, clearing caches and rebuilding the theme the smarty {debug} control does not work anymore. Adding {debug} to a block in frontend/index/index.tpl leads to:

\n

Just a newline, apart from a blank page. Inserting {debug} to a block deeper inside just renders a blank page.

Removed wbm and {debug} works as usual.

Why Trigger DOM Ready

For what reason you recommend to use the Trigger "DOM ready" in your configuration sheet, why not use "Pageview"

Matomo (Piwik) Tag Manager

Seit ser neuesten Version ist der Matomo TagManager offiziell "fertig"

Ist von eurer Seite angedacht den WbmTagManager zu erweitern für Matomo?

Does not work for pre payment in Shopware

In case a customer pays with pre-payment, it does not recognize the events. In analytics, it looks like no purchase have been done, and the payment has been interrupted.

Which smarty variable for add to cart

hi @dneustadt,

thanks for this very helpful plugin. Nevertheless I do not get the datalayer filled with information regarding the add to cart event (on the product detail page).
Only two variables work: quantity and id. everything else is not filled out.

I tried this config:

grafik

grafik

Any hint would be appreciated..

thanks in advance!

Matomo Tag Manager

Please describe the feature you would like to see implemented.

Wäre es bei den Plugin auch möglich die Anpassung wie die beim SW6 Plugin möglich um den Matomo Tag Manager nutzen zu können?

tracking of user data on cached pages

if you create a tag, which tracks personal data on cached pages, you will track wrong data.

detail page for example:
If you are the first customer, your personal data will be added to the tag. Because the page is cached, the tag with your data is also cached and will be served to all customers who load that page.
If the first customer is not logged in, the tag will track empty data for all page views.

Is there any chance to track dynamic data with this tag manager?

Not allowed by security setting

Hi,

We experience the following issue in our shop (SW 5.6.6):

directory /custom/plugins/WbmTagManager/Resources/views/frontend/index/index.tpl' not allowed by security setting

This error only occurs when we use the CASH payment option. The user will get an HTTP 500 error when he is redirected to the finish page. This behaviour does not occur when using any other (external) payment option.

I cant figure out what the problem here is...

Thanks, Nathan

Shopware: no purchase gets tracked for google analytics

Whatever purchase is done, no currency value gets taken over by google analytics.

Overall: Even with purchases done, google analytics reflects: that 100% of the customers are "leaving" the shop before purchase is done. Further: no currency value is tracked in any stage of the shopping process

TypeError (Cannot read property 'find' of undefined) in onProductClicked

Hi,

we're getting this problem a few times a day in our bug tracker via Sentry. It seems that under certain conditions, the impressions field under dataLayer.ecommerce is undefined for some users so the call to find() in jquery.product-click-tracking.js throws this error. I have not been able to reliably reproduce this, except when I manually delete it from the data layer, so I can't really say what the users are doing exactly to trigger it.

We're running SW 5.6.7.

Sanitize product/category data

PHP Version

8.1

Shopware Version

5.7.16

Expected behaviour

No error 500.

Actual behaviour

Some categories were throwing a error 500 when using WbmTagManger is active.
We were able to trace it back to leftover line breaks \n in product titles. (For your information, the products were imported via an importer from a CSV file provided by the customer).

The error occurred at the following location:

array_walk_recursive($dataLayer, [$this, 'castArrayValues']);

(Yes, actually you should avoid the error beforehand by cleaning the data during import - but double is better).

How to reproduce in a demoshop

Put some \n s into product title

Subscriber Struktur

Hallo David,
ich hab dein Plugin etwas refaktoriert. Dabei habe ich mich gefragt wieso du nicht die ganze Arbeit im FilterRender Handler machst. Der Weg über den PostDispatch in den Variables Service als Zwischenspeicher kommt mir doch etwas umständlich vor. Oder gibt es irgendwas, was ich übersehen habe und wieso das Ganze so besser ist?!?
VG Arne

shopware 6 support

hey,

Are you going to support shopware 6? if yes, what is your timeline for that release?

Deleting an article from the shopping cart does not cause a DataLayer push.

Since the Shopware update to version 5.6.x, deleting an item from the shopping cart no longer causes a DataLayer push. The reason for this is a redirect after deletion, which was introduced after the update to 5.6.0.

The following entry in the UPRADE-5.6.md was found:

  • Changed the following cart actions to redirect the request to allow customers to press reload:
    Shopware_Controllers_Frontend_Checkout::addArticleAction
    Shopware_Controllers_Frontend_Checkout::addAccessoriesAction
    Shopware_Controllers_Frontend_Checkout::deleteArticleAction

get the product category at purchase

The only enhanced ecommerce value i am currently missing in my analytics report is the performancy by product category.
Is it possible to get the only/default/first category for each product in the checkout event?

I've tried using dbquery, but couldn't find the relation between the article id and the s_categories table.

Feature Request: IP Filter for internal traffic

Would like to have a possibility to add specific IP addresses via config to exclude internal traffic. I will try to add this feature by my own. It would be great to get contributer permissions for that.

Modifier 'substr' not allowed by security setting

Hi guys!

After upgrading Shopware to version 5.2.25 and Tag Manager to version 2.0.0 my shop frontend throws an exit error on all category listings and product pages.

The error says "Modifier 'substr' not allowed by security setting".

The Smarty modifier gets introduced in lines with "currencyCode" in the file Resources/sql/install.sql.

I've deactivated the plugin and my shop is running again. Is there a way to fix the error without loosing security? Maybe by adding substr to the array of allowed modifiers?

http://www.smarty.net/docs/en/advanced.features.tpl

Best,
Stefan

Shopware => 5.7.x

Hello,
the plugin is not yet compatible with the current Shopware version 5.7.x. Is an update planned?

Many greetings Armin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.