Third-party ad tags typically contain placeholders, known asmacros, which are dynamically replaced by a Demand-Side Platform (DSP) when the ad is served. Below are the key components:
Sample Adtag:-
The ad tag contains macros such as:
The DSP will replace these macros with actual values when serving the ad:
DSP will replaceCLICK_URL_ENCin the adtag withencodeURIComponent()of click tracking url which looks similar tohttps://yourtrackingurl.com?someparameters&redirect=
It is ending with=at the end, where adserver will append the landing page url. (explained in point 3)
DSP will track clicks and redirect toredirectparam provided by adserver.
After replacing the macros, the ad server forms thefinal click URLby appending the landing page URL to the tracking URL. It then triggers a redirect, sending the user to the target page.Example:
letfinal_click_url = expanded_click_macro + landing_url;window.open(final_click_url,true);// DSP will track clicks and redirect to `redirect` param provided by adserver.In this example,expanded_click_macrois the fully expanded tracking URL, andlanding_urlis the destination URL for the ad.
Back to all guides