Event Tracking Guide
After adding the Tracklution Main script to your website, you can start tracking events.
You will need to add the code to the relevant pages on your website. For example, if you want to track a "Purchase" event, you will need to add the code for the "Purchase" event to the purchase confirmation page on your website which will trigger the "Purchase" event.
Event types
Standard Events
| Event type |
| PageView |
| ViewContent |
| AddToCart |
| CompleteRegistration |
| StartTrial |
| Subscribe |
| InitiateCheckout |
| Lead |
| Purchase |
| ContactInfo |
Custom Events
On top of the above mentioned Standard Events, you can use any Custom scrips also. Just change the event name in the script to match the event name you prefer using and install the script in the desired location or action on the site.
<script>
tlq('track', 'CustomEventNameHere');
</script>Purchase Event
The Purchase event is used to track a purchase on your website. The "Purchase" event also needs a third parameter which is an object containing the purchase data.
<script>
tlq('track', 'Purchase', {value: 2.25, currency: 'EUR'});
</script>Partial Purchases or Virtual Purchases
This is useful if you wish to track virtual purchases or your business model includes multiple purchases happening within one session.
Tracklution will gather all partial purchases and calculate them together, and pass them on to Connectors as a single Purchase.
Partial Purchases collected within a session can be overwritten with an actual Purchase (Purchase that does not include ´isPartial´ setting).
Use case example 1:
You want to provide additional Purchase signals to Ad platforms of users that have shown valuable actions in the site but who do not finalise actual purchase.
This could be for example a user that spent a lot of time in the site and gathered products to shopping cart, but never finalised the purchase. Another good example is to set a Partial Purchase for a customer that subscribes to Newsletter, because you can later reach and convert the user via direct marketing.
We would like to tell to Ad platform that this was still a fairly good visitor (compared to visitors who do not perform any valuable actions).
We can set a Purchase event with partial Purchase that captures e.g. 5% of the shopping cart value:
<script>
tlq('track', 'Purchase', {value: 5%ofShoppingCartValueHere, currency: 'EUR', isPartial: true});
</script>Tracklution gathers this partial Purchase information and waits if actual final Purchase happens.
- If there is no final Purchase, Tracklution will send this partial Purchase to ad platform to provide additional signals of engaged users.
- If the final, real Purchase happen, this partial Purchase is overwritten and the actual Purchase with actual value is sent forward and partial Purchase is ignored.
Use case example 2:
Users are making multiple purchases within one session. Tracklution can gather all these purchases and send forward to Connectors as one Purchase (some Ad Platforms only receive one Purchase per session, so in case of multiple Purchases, part of the Purchase value would be lost).
Fire this tag always when partial Purchase happens:
<script>
tlq('track', 'Purchase', {value: PartialPurchaseValueHere, currency: 'EUR', isPartial: true});
</script>ContactInfo event
The ContactInfo event has these parameters:
- "set"
- "ContactInfo" (the type of event)
- an object containing the contact information (email, phoneNumber, firstName, lastName)
To send ContactInfo type event to Tracklution, you need to add the following code to your website's HTML code on the pages you have contact information available on:
<script>
tlq('set', 'ContactInfo', {
email: 'example@email.com',
phoneNumber: '+358501234567',
firstName: 'David',
lastName:'Smith',
birthday: '1985-06-17'
gender: 'male',
address: 'Street 1',
postCode: '11015',
city: 'Berlin',
country:'Germany',
externalId: '123-91197003219'
});
</script>
The example above includes all parameters that can be passed with ContactInfo tag. You can freely choose which parameters to implement, just remove the ones from the script you wish not to implement.
In Google Tag Manager, the tag looks like this when you select the Data Layer Variables instead of using the placeholders:
Data hashing for ContactInfo
Tracklution will naturally take care of hashing the data (SHA256 decryption) before data is forwarded to any Connectors.
If you wish to hash data before sending it to Tracklution, hashed data can be implemented into the script exactly the same way you would implement non-hashed data, for example instead of "email: 'example@email.com' ", you can insert hashed value: "email: 'hashedValueHere'".