This article provides a methodology for testing ads. It involves two or more Transaction tests that make use of global variables.
The ad auction bidding process that is employed by all the major ad serving companies is great for delivering the most relevant ads possible to the end-user, but the dynamic nature of it makes it very difficult to monitor specific ads. Personalization through user data means that you can’t just drop an ad into a test, because you don’t know who will be seeing it.
To solve this problem, we developed a process that emulates real user experience. It starts with a Catchpoint Transaction test for the ad itself, which sets a cookie that gets loaded by the companion transaction test.
// Step - 1
var d = ${time(DD)};
var day = ${switch("${var(d,mod(2))}", "1", "odd", "0", "even")};
open("http://ad.doubleclick.net/N6245/xxxx/xxxxx.xxxxx.footer/mrec_first;sz=300x250;") setHeader("cookie", "${switch('${var(day)}', 'odd', '${GlobalVariable(even)}', 'even', '${GlobalVariable(odd)}')}")
The second transaction test opens many URLs of popular consumer websites and grabs the cookies that they set on the ad server’s domain. Those cookies are stored in a global variable to be used by the ad test.
// Step - 1
var d = ${time(DD)}; var day = ${switch("${var(d,mod(2))}", "1", "odd", "0", "even")}; open("http://www.url1.com")
// Step - 2
open("http://www.url2.com")
// Step - 3
open("http://www.url3.com")
// Step - 4
open("http://www.url4.com")
// Step - 5
open("http://www.url5.com")
// Step - 6
open("http://www.url6.com")
// Step - 7
open("http://www.url7.com")
// Step - 8
open("http://www.url8.com")
// Step - 9
open("http://www.url9.com")
// Step - 10
open("http://www.url10.com")
// Step - 11
open("http://www.url11.com")
// Step - 12
open("http://www.url12.com")
// Step - 13
open("http://www.url13.com")
// Step - 14
open("http://www.url14.com")
// Step - 15
open("http://www.url15.com")
// Step - 16
open("http://www.url16.com")
// Step - 17
open("http://www.url17.com")
// Step - 18
open("http://www.url18.com")
// Step - 19
open("http://www.url19.com")
// Step - 20
open("http://www.url20.com")
// Step - 21
open("http://www.url21.com")
// Step - 22
open("http://www.url22.com")
// Step - 23
open("https://ad.doubleclick.net") storeGlobalVariable("${Extract(req-header, regexpi:cookie: (.*))}", "${switch('${var(day)}', 'odd', 'even', 'even', 'odd')}")
When the ad targeting happens, the test agent loads the actual ad, which can pick up all of the cookies that have been stored, making it look like a real person has been using the computer. This generates a real-time targeted ad instead of a placeholder ad, so realistic performance is measured.
Even/odd day-of-month logic is included so that on even days the loaded cookie is stored in a variable called “even”, and on odd days the loaded cookie is stored in a variable called “odd”. On even days the ad test uses the cookie in the “odd” variable and vice versa to prevent using a cookie that isn’t “loaded".