TAmedia Tracking Guide EN
TAmedia Tracking Integration Guide
This document explains how to integrate the tracking code provided by TAmedia into a website. It covers the base tracking code, category page view events, custom events, and important notes.
1. Base Tracking Code Integration
Placement
Insert the following code within the <head> tag, right above the </head> tag. If your page already includes this code, no need to insert repeatedly..
This script is TAmedia’s main tracking script and will automatically load the required tracking tool (pixel.js).
<script type="text/javascript">
(function(a,e,f,g,b,c,d){a.taq||(a[b]=a[b]||function(){a[b].q.push(arguments);a[b].tamTrackSendStatus&&a[b].tamTrackSendStatus()},a[b].q=a[b].q||[],c=e.createElement(f),d=e.getElementsByTagName(f)[0],c.async=1,c.src="https://adc.tamedia.com.tw/tr/"+g,d.parentNode.insertBefore(c,d))})(window,document,"script","pixel.js","taq");
</script>
2. Page View Event
When to Trigger
When a user visits a page, execute the following script to send a corresponding event.
This records a ViewContent event indicating that the user visited a specific page.
<script type="text/javascript">
taq('track', '{your-campaign-id-goes-here}', 'ViewContent');
</script>
3. Custom Event Tracking
Purpose of Custom Events
When specific actions occur on your site (e.g., registration completed, a particular button clicked, a form successfully submitted), execute the following code to log the event.
{your-event-name-goes-here}
is a custom event name (e.g., Customer00001
) that must be pre-defined by TAmedia for each campaign.
This code logs a custom behavioral event. The event name must match the one configured in TAmedia’s system.
<script type="text/javascript">
taq('trackCustom', '{your-campaign-id-goes-here}', '{your-event-name-goes-here}');
</script>
Notes
- The identifier
'{your-campaign-id-goes-here}'
should be configured according to the specific campaign. - The
taq
object must be called after the base tracking script has been executed; otherwise, errors may occur. - To track multiple different events, you can reuse
taq('trackCustom', ...)
with different event names. - To confirm successful tracking, please contact the TAmedia technical team for reporting or verification support.
Contact Information For further integration support, please contact the TAmedia technical support team.