Events Setup on Tagely
Introduction
Events are used by Tagely (https://tagely.com) to track important events on your website. Examples are leads, purchases, etc.
The first step to set up events is always to install the Tagely base pixel code, which you can find on your account homepage when you login to Tagely, on all your webpages in the website header between the head tags.
After this, you can set up specific events on specific pages of your website as needed. For example, a thank you page for filling out a form would be a good place for a lead event, and a thank you page for checking out a shopping cart would be a good place for a purchase event.
Event Types
Currently Tagely has the following defined events, listed below with example scripts for each:
Lead Event:
<script>
tgl(‘lead’, {name: ‘Mary Joe’, phone: ‘123-456-7890’});
</script>
Purchase Event:
<script>
tgl(‘purchase’, {currency: ‘USD’, value: ‘30.00’});
</script>
Subscription Event:
<script>
tgl(‘subscribe’, {currency: ‘USD’, monthlyCharge: ‘30.00’, subscriberId: ‘subscriber123’});
</script>
Subscription Event (non-conversion):
<script>
tgl(‘subscribeNoConv’, {currency: ‘USD’, monthlyCharge: ‘0.00’, subscriberId: ‘subscriber123’});
</script>
Formatting and placement
You should use the format above. The event properties in curly brackets { } are up to you, and you can use more or less event properties as desired. Property values should be in single quotes (‘) as above. If not passing any event properties, you should still have the curly brackets, eg:
<script>
tgl(‘lead’, {});
</script>
If using software which employs Tagely events such as ReferDigital, certain properties may be required as explained further there.
We recommend these scripts be placed in the body of your webpage between the <body> … </body> tags.
Conversion vs. non-conversion events
The lead, purchase, and subscribe events are examples of conversion events. In your Tagely analytics, you will see these reported as conversions. The subscribeNoConv event is an event which will be recorded but not be counted as a conversion in your analytics.
For example you can use the subscribe event to record a subscriber signing up to a free trial or paid subscription in your system if you consider that to be a conversion. If you consider changes to the subscriber plan not to be conversions, you can use the subscribeNoConv event to record those. For plan cancellations you can use a subscribeNoConv event with the monthlyCharge set to 0.00.
De-Duplication
It is strongly recommended that you pass a special “unique_id” parameter with your events if possible, containing a unique_id your system generates that identifies that particular event uniquely. For example, this could be a unique order ID for purchases. If that is made available to Tagely, Tagely will use it to de-duplicate your events, i.e. only one event will be recorded for each unique_id.
Here’s an example using this unique_id parameter:
<script>
tgl(‘purchase’, {unique_id: ‘12345’, currency: ‘USD’, value: ‘30.00’});
</script>
Now if the website visitor reloads the conversion thank you page, only one such event will be recorded, since the unique_id should be the same for the same purchase.
Posting Events via the Tagely API
Tagely supports recording events programmatically via the Tagely API and provides an endpoint to do so. Examples of when you might want to do this are to record events such as subscription updates using the subscribeNoConv event. Often these are not associated with a corresponding page view and happen independently of direct user action on your website, such as when a subscription updates to a paid monthly charge after a free trial period.
The Tagely API also makes it possible to record events without installation of the Tagely pixel base code if you wish to do so for any reason. Your server can also post tracking data (UTM parameters, affiliate IDs and sub IDs) directly through the API to associate with each event. However page views will not be tracked and Tagely analytics will not be available in this case.
For more details, please the Events API Setup section in your Tagely account.