「TAmedia Tracking Guide EN」修訂間的差異

出自TAMedia
跳至導覽 跳至搜尋
 
(未顯示同一使用者於中間所作的 3 次修訂)
行 1: 行 1:
= TAMedia Tracking Integration Guide =
= 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.
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.


----
----
行 12: 行 12:
If your page already includes this code, '''no need to insert repeatedly.'''.
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'').
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. Category Page View Event ==
== 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-name-goes-here}</code> is a custom event name (e.g., <code>Customer00001</code>) that must be pre-defined by TAMedia for each project.
<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 TAMedia’s system.
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">
行 58: 行 58:
== Notes ==
== Notes ==


* The identifier <code>'{your-campaign-id-goes-here}'</code> should be configured according to the specific project.
* 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 TAMedia technical team for reporting or verification support.
* 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 TAMedia technical support team.
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.