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]
- Image URL
https://www.example.com/ad.gif?1732182487
- Click URL
https://www.example.com/landing.page?1732182487
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.
- Accelerated Mobile Pages Project - AMP Ad Tag
- Can I have ads refresh automatically without a page reload?
- How can I avoid document.write warning in Chrome?
- How can I avoid duplicate ads on the same page?
- How can I combine multiple ads in the same placement?
- How can I defer ads until after the page has finished loading?
- How can I display an ad only when it is visible on screen?
- How can I measure ad viewability?
- How can I mix ad dimensions or mix banners with text-link ads?
- How can I put ads into my blog/website?
- How can I serve multiple ad dimensions in the same place?
- How can I serve multiple zones with a single server request?
- How can I support click tracking for external ad servers?
- How can I turn off ad serving error messages?
- How do I display mobile ads using Android WebView?
- How do I display mobile ads using Apple iOS WKWebView?
- How do I integrate AdSpeed mobile ad serving API?
- How do I make ads responsive on mobile devices?
- How do I pass custom data and variables into the ad?
- How do I set up advertising on WordPress?
- How do I setup a companion ad in video ad serving?
- How do I setup a passback ad tag?
- How do I switch to secure SSL/https ad serving?
- Should I use protocol-relative URLs in ad tags?
- What are custom ad serving settings and variables?
- What are different formats of serving code?
- What are different types of ad tag?
- What are the effects of ad blocking software?
- What is the pop-up and pop-under ad tag?
- What is the serving code or ad tag?
- What is WMODE for SWF ads? How can I change it?
- Where is the publisher-side file for iframe busting?
- Why doesn't the provided HTML serving code work?
Cannot find an answer for your question? Ask our Customer Care team
Related
- What are custom ad serving settings and variables?
"These are additional settings available to the serving code for advanced functionality. Custom Parameters You can enter one of the ..."
- How do I track clicks for HTML or Rich-Media ads?
"To track clicks for Rich-Media/HTML ads, check "Automatically process HTML code to track clicks" below the HTML code box. This ..."
- How can I support click tracking for external ad servers?
"This feature is used when you send AdSpeed's ad tag to another ad server and the other ad server also ..."
- How to convert a date string to a unix timestamp and vice versa?
"The Unix timestamp, also called "epoch", is the number of seconds since January 1, 1970. It is often used to ..."
- Image Banner with Multiple Clickable Buttons
"Normally, an image ad is associated with one click URL and the whole image is clickable. However, you can have ..."
in Ad Gallery