Event Tracking via Classes
How to Track Website Elements via Classes
A list of different classes to apply to elements to assign specific events to them
By default PixelFlow tracks Page View event on any page load. If you want to track more events, there are two ways to do this:
Use Event URL tracking - assign a URL to a specific event
Tag elements on your website - use the below "classes" to assign tags to elements on your website so PixelFlow knows what was clicked
A common example is tracking a Subscribe event when user clicks on a specific button on your website.
Another use case is to track a Lead event when user fills out a form on your website and submits it.
Below is an explanation of which classes to apply to different elements on your website:
Add General events classes to buttons or interactive elements to initiate the event.
Add Form events classes to form elements, like user name, email etc. to extract that information from the form and add it to the event payload.
Add Purchase events classes to elements on your cart, checkout or order confirmation page etc. to extract product information from the elements and add it to the event payload. Relevant for the following events:
Add To Wish List,Add To Cart,Initiate CheckoutandPurchase
Please note - there are different ways to apply these classes depending on your platform:
Instructions for Each Website Platform
These classes are for reference - please read the documentation for your platform first:
General Event Classes
AddPaymentInfo | Subscribe |
|---|---|
Contact | InitiateCheckout |
AddtoCart | AddtoWishlist |
CompleteRegistration | CustomiseProduct |
Donate | Lead |
StartTrial | SubmitApplication |
SearchInput | SearchButton |
FindLocationInput | FindLocationButton |
Purchase | ViewContent |
eCommerce Events Classes Document
To enrich eCommerce event data you can add the following additional classes to elements on your website in order to provide further data to Meta. Commerce events require multiple nested classes to track item information.
Apply these classes to the elements on your cart, checkout or order confirmation page to trigger the following events: Add To Wish List, Add To Cart, Initiate Checkout and Purchase.
(REQUIRED) Add this to the overall main/parent container containing all the products and a button | |
|---|---|
Add this to the total amount (if exists): | |
(REQUIRED) Add this to the individual product container containing all the product information | |
Add this to the product id. Please note:
| |
Add this to the product price: | |
Add this to the product quantity: | |
Form Event Classes
Form events track form submissions and capture form field values. Add these classes to form elements and input fields - can be used with AddPaymentInfo, CompleteRegistration, Lead, StartTrial, Subscribe, Contact and SubmitApplication events to further enrich the data. Note: if you are adding value classes for name, email etc. you must add necessary classes to container or form.
Apply this class to the form container or the form element: | Apply this to a value or price: |
|---|---|
Apply this to the first name input: | Apply this to the email input: |
Apply this to the last name input: | Apply this to the phone input: |
Apply this to the search/location input: | |
Any other questions? Get in touch