Wehaa Pixel Tracking Installation
Step 1
Install the code below in each page that will be tracked in their HTML header section;
or without html version:
Step 2
Execute the function inside the initTracking listener function below where you need to track the event:
Methods:
wevent(category, type)
Method to track events
Params:
- category: string - Category of pixel event (view | conversion)
- type: string - Name of event (default value: "default")
Examples:
wevent('conversion'); // Send a conversion type "default"
wevent('conversion', 'lead'); // Send a conversion event with the name "lead"
Types Used:
| Name | Type | Description |
|---|---|---|
| add_to_cart | Add to cart | Add an item to the cart |
| add_to_wishlist | Add to wishlist | Add an item to the wishlist |
| complete_registration | Complete registration | Complete the registration |
| contact | Contact | Contact the business |
| initiate_checkout | Initiate checkout | Start the checkout process |
| lead | Lead | Generate a lead |
| schedule | Schedule | Schedule an appointment |
| search | Search | Perform a search |
| subscribe | Subscribe | Subscribe to a service |
Tracking Object.
When is called the callback the tracking object is passed as a parameter for use its methods
and properties in the callback function.
Here are the main methods:
event(category, type)
Method to track events the wevent is the alias of this one.
Params:
- category: string - Category of pixel event (view | conversion)
- type: string - Name of event (default value: "default")
Examples:
window.initWehaaTracking = function(tracking) {
tracking.event('conversion'); // Send a conversion type "default"
tracking.event('conversion', 'lead'); // Send a conversion event with the name "lead"
}
attachIframeEvent(selector, category, type)
Params:
- selector: string - Selector css of the iframes.
- callback: function - function to be executed in the iframe load
Examples:
window.initWehaaTracking = function(tracking) {
tracking.attachIframeEvent('iframe', function (iframeDoc) {
$(iframeDoc).one('click', 'body', function () {
wevent('conversion', 'lead');
});
});
}
Configs:
debug
Global object for config wehaa tracking
Options:
- debug: 1 for enable console javascript debug.
- testing: 1 for enable console send events debug and doesn't send ajax request to wehaa analytics.
- keywords: An array of keywords for automatic send convertion events.
Examples:
window.wconfig = {debug:1, testing:1}
Implementation example:
window.keywords = [{keyword:"add to cart"}, {keyword: "contact"}}]
Implementation example:
Examples
Implementation with jQuery
HTML
Shopify Implementation
- Go to your Shopify admin
- Go to Settings
- Go to Customer Events
- Click on Add a Custom Pixel
- Insert the code below
- Click on Save
- Click on Connect
- And Test