Help Center Manage Your Account Ad Tag

How do I add current timestamp into the serving code?

When creating and setting up a new ad, you can put an always-changing value into the ad code for cache busting or as a random number. The macros [timestamp], [cachebuster] (or [cache_buster]) will be replaced with a time stamp by our ad server for each ad serving. The time stamp is the number of seconds since January 1, 1970. The macros [randomnumber] (or [random_number]) will be replaced with a random number.

Example

When creating a new image ad, these are the URLs:
  • Image URL
    https://www.example.com/ad.gif?[timestamp]
  • Click URL
    https://www.example.com/landing.page?[timestamp]
When this ad is actually displayed to ad viewers, these are the actual URLs:
  • Image URL
    https://www.example.com/ad.gif?1732178497
  • Click URL
    https://www.example.com/landing.page?1732178497

This placeholder or macro is used by many different ad serving systems, including DoubleClick's DART ad server, to avoid ads being cached by the client's browser. Different ad servers can use different naming conventions for this parameter. On the other hand, if you must retain the original macro [timestamp] and do not want it to be replaced, use [asis_timestamp].

Other Articles in Ad Tag

This section describes the ad tag (serving code) with basic and advanced settings. It includes common ad serving setup instructions and answers frequently asked questions when integrating the ad tag into your site, blog or app.

Cannot find an answer for your question? Ask our Customer Care team

Related