Skip to main content

Click Counting macros

These click macros are specifically to be changed/added in third-party tags. When clicking, the adserver is called to send a postback which allows mediasmart to register the click.

If you are implementing a third-party tag be sure to use one of the following click macros:

Type

Macro

Description

Click

%click_url_unesc%

Counts the click and redirects to the final destination URL. Unescaped

Click

%click_url_esc%

URL of the creative. Counts the click and redirects to the final destination URL. One level of encoding

Click

%click_url_esc_esc%

URL of the creative. Counts the click and redirects to the final destination URL. Two levels of encoding

Destination

%dest_url_unesc%

Final destination URL of the creative. Unescaped

Destination

%dest_url_esc%

Final destination URL of the creative. One level of encoding

Destination

%dest_url_esc_esc%

Final destination URL of the creative. Two levels of encoding

Target

%target_url_unesc%

URL and final destination URL of the creative. Unescaped

Target

%target_url_esc%

URL and final destination URL of the creative. One level of encoding

Target

%target_url_esc_esc%

URL and final destination URL of the creative. Two levels of encoding

3 groups of click macros

As you can see, we have three groups of macros: click, destination, and target.

All of them count clicks for mediasmart, but each one works slightly differently:

Click %click_url_xxx%

The macro is replaced by a URL to notify mediasmart about the click.

This is usually the macro you should use if you want mediasmart to count clicks generated by your tag. It can work for both redirect and pixel.

This macro should not be used when the client is measuring with mediasmart pixels, as this macro does not pass the parameters required for conversion measurements in the URL.

Destination %dest_url_xxx%

The macro is replaced by the click URL of the creative with any macro included in it already resolved.

Target %target_url_xxx%

The macro is replaced by the click URL of the creative and will also include the destination (redirect to the Click URL).

This is the recommended click macro when the campaign in which it is used measures conversions with the mediasmart pixel.

Levels of escape

Each group has the same three levels of escape:

  • %xxx_url_unesc%: provides the unescaped (decoded) desired URL. For instance:

    https://example.com/resource/page?%5=1/parameter?hello=e

  • %xxx_url_esc%: provides the desired URL with one level of encoding (escaped).

    https%3A%2F%2Fexample.com%2Fresource%2Fpage%3F%255%3D1%2Fparameter%3Fhello%3De

  • %xxx_url_esc_esc%: provides the desired URL with two levels of encoding (two times escaped).

    https%253A%252F%252Fexample.com%252Fresource%252Fpage%253F%25255%253D1%252Fparameter%253Fhello%253De

How they work

An example:

<img src="%click_url_unesc%%dest_url_unesc%" width="1" height="1"> = <img src="%target_url_unesc%" width="1" height="1"> = <img src="%click%" width="1" height="1">