Change default events
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.
Short explanation
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.

Opt-In Variables
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']
Event Variables
Here you find a list of the Twig variables listed per event:
Add to card
Variable
Type
Example
products
array
[{ number: 'xxxxx', name: 'Burger', priceNet: 9.99, ... }]
totalPrice
int
9.99
Begin checkout
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
Click product
Variable
Type
Example
product
object
{ number: 'xxxxx', name: 'Burger', priceNet: 9.99, ... }
Login
Variable
Type
Example
method
string or null
Login
Purchase
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
Register
Variable
Type
Example
method
string or null
'Login'
Remove from card
Variable
Type
Example
products
array
[{ number: 'xxxxx', name: 'Burger', priceNet: 9.99, ... }]
totalPrice
int
9.99
Search
Variable
Type
Example
searchTerm
string
'My search term'
View product
Variable
Type
Example
product
object
{ number: 'xxxxx', name: 'Burger', priceNet: 9.99, ... }
View product list
Variable
Type
Example
products
array
[{ number: 'xxxxx', name: 'Burger', priceNet: 9.99, ... }]
totalPrice
int
9.99
View product search
Variable
Type
Example
products
array
[{ number: 'xxxxx', name: 'Burger', priceNet: 9.99, ... }]
totalPrice
int
9.99
searchTerm
string
'My search term'
Last updated
Was this helpful?