Change default events
Last updated
Last updated
With Pixel Your Shop it is possible to completely override the standard events for all pixels with your own dynamic code. This also allows special configurations and customer requirements, which are difficult or impossible to implement with conventional plugins.
Tip
You can configure the following steps per sales channel & language individually, which ultimately gives you more flexibility during development.
Each pixel code is dynamically generated in the frontend with Twig. Twig is a simple template language that generates the actual Javascript code for tracking in this case, which the end user of the shop finally triggers.
The advantage of Twig is that dynamic variables such as products
can be used, which are used when generating the tracking code contain the correct product data. Due to the flexible structure, you can easily add custom lines of code or also replace complete scripts.
To edit the code, you have to click on the gear symbol
in the opt-In & event boxes and activate the switch Use own code
then.
Here is a list of the Twig variables that can be used during the opt-in:
Pixel
Variable
Type
Example
Google gtag
googleAnalyticsTrackingIds
array
['UA-xxxxxxxxx-x']
Google gtag
googleAdsConversionIds
array
['AW-xxxxxxxxx']
Google gtag
googleAnonymizeIp
bool
true
Google Tag Manager
googleTagManagerContainerIds
array
['GTM-xxxxxxxx']
facebookPixelIds
array
['xxxxxxxxxx']
Hotjar
hotjarIds
array
['xxxxxxxx']
Here you find a list of the Twig variables listed per event:
Variable
Type
Example
products
array
[{ number: 'xxxxx', name: 'Burger', priceNet: 9.99, ... }]
totalPrice
int
9.99
Variable
Type
Example
affiliation
string or null
affiliateCode/campaignCode
coupon
string or null
christmas_10
products
array
[{ number: 'xxxxx', name: 'Burger', priceNet: 9.99, ... }]
totalPrice
int
9.99
Variable
Type
Example
product
object
{ number: 'xxxxx', name: 'Burger', priceNet: 9.99, ... }
Variable
Type
Example
method
string or null
Login
Variable
Type
Example
orderNumber
string
'xxxxx'
shipping
int
2.99
affiliation
string or null
affiliateCode/campaignCode
coupon
string or null
christmas_10
products
array
[{ number: 'xxxxx', name: 'Burger', priceNet: 9.99, ... }]
totalPrice
int
9.99
totalTax
int
9.99
Variable
Type
Example
method
string or null
'Login'
Variable
Type
Example
products
array
[{ number: 'xxxxx', name: 'Burger', priceNet: 9.99, ... }]
totalPrice
int
9.99
Variable
Type
Example
searchTerm
string
'My search term'
Variable
Type
Example
product
object
{ number: 'xxxxx', name: 'Burger', priceNet: 9.99, ... }
Variable
Type
Example
products
array
[{ number: 'xxxxx', name: 'Burger', priceNet: 9.99, ... }]
totalPrice
int
9.99
Variable
Type
Example
products
array
[{ number: 'xxxxx', name: 'Burger', priceNet: 9.99, ... }]
totalPrice
int
9.99
searchTerm
string
'My search term'