Pixel Tracking

Treasure Data users can send events via Pixel Tracking.

Table of Contents

Prerequisites

  • Basic knowledge of Treasure Data

Preparing URL

Authentication

Every request must contain authentication information, provided by the special td_write_key URL parameter. The apikey can be retrieved from the console (click here). It’s recommended to use write-only API key.

http://in.treasuredata.com/postback/v3/event/{database}/{table}?td_write_key=XXXYYYZZZZ&...

Parameters

Please specify these two parameters within a path.

  • {database}: specify destination database name in URL. only alphabets/numbers or _ are allowed.
  • {table}: specify destination table name in URL. only alphabets/numbers or _ are allowed.

Any URL parameter, except special parametes listed below, is considered as a column inside the record.

  • td_write_key: Already described above.
  • td_record_time: Please specify UNIX timestamp value, to set time column in Treasure Data. If it’s not specified, the time records were received will be used instead.
  • td_global_id: If we add td_global_id=td_global_id in the query string of postback url, API add a column named td_global_id with value of actual td_global_id into the record.
  • td_ip: If we add td_ip=td_ip in the query string of postback url, API add a column named td_ip with value of source IP into the record.
  • td_ua: If we add td_ua=td_ua in the query string of postback url, API add a column named td_ua with value of actual user-agent into the record.

All parameter’s value is considered as string, and you don’t have a way to change it at the ingestion time with pixel tracking.

Example URL structure should be something like this:

http://in.treasuredata.com/postback/v3/event/{database}/{table}
  ?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 with <img> Tag

Finally, you can use the URL above, with img HTML tag.

<img src="http://in.treasuredata.com/postback/v3/event/{database}/{table}?td_write_key=XXXYYYZZZZ&td_global_id=td_global_id&td_ip=td_ip&td_ua=td_ua&key1=val1&key2=val2&key3=val3..." />

Last modified: Oct 21 2016 05:26:50 UTC

If this article is incorrect or outdated, or omits critical information, please let us know. For all other issues, please see our support channels.