「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, '''do not insert it again'''.…」的新頁面) |
|||
(未顯示同一使用者於中間所作的 5 次修訂) | |||
行 1: | 行 1: | ||
= | = TAmedia Tracking Integration Guide = | ||
This document explains how to integrate the tracking code provided by | This document explains how to integrate the tracking code provided by TAmedia into a website. It covers the base tracking code, page view events, custom events, and important notes. | ||
---- | ---- | ||
行 10: | 行 10: | ||
Insert the following code '''within the <head> tag''', right '''above the </head> tag'''. | Insert the following code '''within the <head> tag''', right '''above the </head> tag'''. | ||
If your page already includes this code, ''' | If your page already includes this code, '''no need to insert repeatedly.'''. | ||
This script is | This script is TAmedia’s main tracking script and will automatically load the required tracking tool (''pixel.js''). | ||
<syntaxhighlight lang="html"> | <syntaxhighlight lang="html"> | ||
行 22: | 行 22: | ||
---- | ---- | ||
== 2. | == 2. Page View Event == | ||
=== When to Trigger === | === When to Trigger === | ||
行 44: | 行 44: | ||
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. | 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. | ||
<code>{your-event- | <code>{your-event-name-goes-here}</code> is a custom event name (e.g., <code>Customer00001</code>) 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 | This code logs a custom behavioral event. The event name must match the one configured in TAmedia’s system. | ||
<syntaxhighlight lang="html"> | <syntaxhighlight lang="html"> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
taq('trackCustom', '{your-campaign-id-goes-here}', '{your-event- | taq('trackCustom', '{your-campaign-id-goes-here}', '{your-event-name-goes-here}'); | ||
</script> | </script> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
行 58: | 行 58: | ||
== Notes == | == Notes == | ||
* The identifier <code>'{your-campaign-id-goes-here}'</code> should be configured according to the specific | * The identifier <code>'{your-campaign-id-goes-here}'</code> should be configured according to the specific campaign. | ||
* The <code>taq</code> object must be called '''after''' the base tracking script has been executed; otherwise, errors may occur. | * The <code>taq</code> object must be called '''after''' the base tracking script has been executed; otherwise, errors may occur. | ||
* To track multiple different events, you can reuse <code>taq('trackCustom', ...)</code> with different event names. | * To track multiple different events, you can reuse <code>taq('trackCustom', ...)</code> with different event names. | ||
* To confirm successful tracking, please contact the | * To confirm successful tracking, please contact the TAmedia technical team for reporting or verification support. | ||
---- | ---- | ||
'''Contact Information''' | '''Contact Information''' | ||
For further integration support, please contact the | For further integration support, please contact the TAmedia technical support team. |
於 2025年7月25日 (五) 05:44 的最新修訂
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, 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.