Treasure Data users can use data from a tracking pixel to send events to Treasure Data.
Contents
- Basic knowledge of Treasure Data
You must set up authentication and specify a path before you can add the postback that is used by Treasure Data.
Every request must contain authentication information, provided by the special td_write_key URL parameter. The API key can be retrieved from TD Console. It's recommended to use write-only API key.
https://in.treasuredata.com/postback/v3/event/{database}/{table}?td_format=pixel&td_write_key=XXXYYYZZZZ&...Specify these two parameters within a path.
{database}: specify the destination database name in the URL. Only alphabet, numbers, or _ are allowed.{table}: specify destination table name in URL. only alphabet, numbers, or _ are allowed.
Any URL parameter, except special parameters listed as follows, is considered as a column inside the record.
- td_format: Specify
pixel - td_write_key: As described in Authentication.
- td_record_time: Specify a UNIX timestamp value to set time column in Treasure Data. If it's not specified, the time records that are received are used.
- td_global_id: If
td_global_id=td_global_idin the query string of postback URL is added, then the API adds a column namedtd_global_idwith value of actual td_global_id into the record. - td_ip: If
td_ip=td_ipin the query string of postback URL is added, then the API adds a column namedtd_ipwith the value of source IP into the record. - td_ua: If
td_ua=td_uain the query string of postback URL is added, then the API adds a column namedtd_uawith the value of actual user-agent into the record. - td_redirect: The API can redirect to the specified URL. The URL must be encoded. If the td_redirect value includes td_global_id as a parameter, then the API replaces it with an actual value.
All parameter values are considered as strings, and you cannot change the value type at the ingestion time with a tracking pixel.
For example URL structure would be something like this:
https://in.treasuredata.com/postback/v3/event/{database}/{table}
?td_format=pixel
&td_write_key=XXXYYYZZZZ
&td_global_id=td_global_id
&td_ip=td_ip
&td_ua=td_ua
&your_custom_key1=val1
&your_custom_key2=val2
&your_custom_key3=val3...Use the URL with an img HTML tag as the postback to Treasure Data.
<img src="https://in.treasuredata.com/postback/v3/event/{database}/{table}?td_format=pixel&td_write_key=XXXYYYZZZZ&td_global_id=td_global_id&td_ip=td_ip&td_ua=td_ua&key1=val1&key2=val2&key3=val3..." />Using image tags for tracking in emails is not suggested. This is because emails containing tracking tags from a domain different from the email sender's domain are more likely to be flagged as spam.
Additionally, in recent years, platforms like Apple have started treating open tracking as always open by default, reducing the effectiveness of pixel-based open tracking. Consider a broader marketing strategy that includes directing recipients to landing pages and other engagement methods.