Documentation

Documentation

Using the "pixel"

Used for tasks such as: safe "thankyoupage" tracking, embedding in creatives to count impressions, collecting data from AMP sites, cookie-sync with ad services and DMPs.

The "pixel" — in this context — means a method of collecting data using a transparent 1x1 image (a gif 1x1 image) that is loaded from a tracking server. This is how it obtains information about a visit/view. It can read and set cookies (only on its own domain, the one the pixel is loaded from).

It is the safest tracking method, which is why it is quite widespread in the adtech space. With a pixel you cannot execute code on the page or otherwise interfere with how it works: images load last and do not slow down loading, and an image is treated by the browser as broken if something else arrives in its place.

Some people mistakenly call JavaScript code a pixel — code that has full access to the page at the moment of the visit. Remember: a pixel is an image, and "image" is why it uses the HTML <img tag that embeds it. If a script is embedded, it will have a <script tag.

Main uses:

  1. Placing it on a "thankyoupage" to count conversions. A standard practice for CPA and small ad networks. Major players use JavaScript code and do not offer a pixel option, except perhaps Mail.ru Group affiliates.
  2. Counting display-ad impressions, where it is mixed directly into the creative.
  3. Collecting data from AMP (Accelerated Mobile Pages) sites. A Google technology that lets sites load in an instant. It imposes serious restrictions on what can be used on the page.
  4. Performing cookie-sync (exchanging visitor identifiers). Used in advertising to find a visitor on someone else's territory. For example, in RTB there are 3 main parties: SSP, DSP, and DMP. When bid requests arrive at a DSP, a user identifier from the SSP is passed along and it must be matched to its own identifier. To use DMP data, the DSP needs to know what identifier this user has on the other side.

How to use it#

You need to decide how to name this event so you can tell it apart from others. If you have several projects (sites/apps), assign or make up numbers for them. It is specified as sections in the template. After substitution you get a URL that returns a pixel in response, while all the data is sent for processing.

Template https://{your_rockstat_domain}/{img}/{name}/{projectId}, where

  • your_rockstat_domain: the domain where you have Rockstat installed.
  • img: the name of the internal service. The names img or pixel are preconfigured to return a pixel.
  • name: the name of the event by which you will be able to tell traffic from this pixel apart from others.
  • projectId: the project id, if there are several. Optional.

Example:

https://test.rstat.org/pixel/x1_order_completed

Information about which site the load was performed from, the page path, the browser, the IP, and the rest of the available information will be collected automatically.

You can pass arbitrary parameters using URL query parameters

https://your_rockstat_domain/pixel/x1_order_completed?internal_campaign=superpuper&ad_content=wow

The collected data will be processed by the systems that store it in ClickHouse or stream it to other services.

Requests can be processed programmatically; for this

Installing into page code#

It is placed between <body></body>, and the closer to the beginning, the sooner it starts loading and the greater the chance that it will load.

<img src="https://your_rockstat_domain/pixel/x1_order_completed?internal_campaign=superpuper&ad_content=wow" />

AMP (Accelerated Mobile Pages)#

Using the special <amp-pixel tag

<amp-pixel src="https://test.rstat.org/pixel/amp_pageview" layout="nodisplay"></amp-pixel>

Details on the AMP project page

Markdown#

Use in GitHub and other services that support the markdown format

![https://test.rstat.org/pixel/repo_director_viewed](My lovely little picture)

The result will be the display of a transparent pixel invisible to the eye.

Example with curl#

Open a terminal and run

$ curl https://test.rstat.org/pixel/test?param=myparamvalue --output -

GIF89a...

Curl is a utility for making HTTP requests. You can also use the browser developer tools