SlideShare uma empresa Scribd logo
1 de 22
Dynamic Ad Refresh and
Synching (Real Simple and Golf)
July 15, 2009
IT Watercooler Meeting
v2: June 22, 2010
Business Requirements
• Refresh ads without refreshing the whole
page
• Each refresh = new ad impressions
• Optional: ad synchronization
Problem
• Ads call document.write () to be attached
to the page
• document.write () after page load = blank
page
• Trying to refresh ads on page = blank
page
Solution
• Use iframes and pass ad parameters:
iframe.src = ‘iframead.html?
TiiAdConfig=3475.rsm&…’;
• Each iframe points to the same “ad loader”
page but loads a different ad
• To refresh an ad, make a new call:
iframe.src = ‘iframead.html?...’;
Synchronization
• Pass the same random “ord” parameter
value to each iframe ad
• Pass a different “tileCounter” number
• A “master” iframe ad needs to load first
• It needs to finish loading before the next
iframe ad loads
Queuing Ad Calls
• Each initial iframe ad call gets placed into a
queue
• One iframe ad call is designated as the “master”
(need not be the first one on the page, but there
always has to be a “master”)
• Upon completed page load: the “master” call is
made first
• Upon completed load of the “master” ad iframe,
the rest of the iframe ad calls are made
Required JavaScript Libraries
• jQuery or TIMEINC library
• TiiAd libraries (tii_ads.js) – global ad
libraries for Time Inc websites
• iframeAdFactory
• iframeAd
Samples
• Real Simple
http://cp.timeinc.net:8080/tii/frontend/realsimple/
• Golf
http://www.golf.com/golf/tours_news/leaderboard
• Soon to be on ThisOldHouse.com
• Can be ported to any website that uses
the TiiAd libraries (tii_ads.js)
• Real Simple
http://cp.timeinc.net:8080/tii/frontend/realsimple/l
• Golf
http://www.golf.com/golf/tours_news/leaderboard
• Soon to be on ThisOldHouse.com
• Can be ported to any website that uses the
TiiAd libraries (tii_ads.js)
• Real Simple
http://cp.timeinc.net:8080/tii/frontend/realsim
ple/lotus/test/ad_refresh.html
• Golf
http://www.golf.com/golf/tours_news/leaderb
oard/0,28360,,00.html
• Soon to be on ThisOldHouse.com
• Can be ported to any website that uses the
TiiAd libraries (tii_ads.js)
Test It!
• In the browser address bar, enter:
– Synchronized
javascript:iframeAdFactory.refresh ()
– Unsynchronized
javascript:iframeAdFactory.refresh (true)
– Note: iframeAdFactory.refresh () is the function that
the JavaScript or SWF code needs to call to make a
synchronized refresh
Converting Standard Ads to Iframe
• Standard
<script type="text/javascript">
var adConfig = new TiiAdConfig("3475.golf");
adConfig.setCmSitename("cm.golf");
adConfig.setRevSciTracking(true);
var adFactory = new TiiAdFactory(adConfig,
"tours_news/leaderboards");
adFactory.setChannel("tours-news");
adFactory.setSubchannel("leaderboard");
adFactory.setChannelPage();
adFactory.setParam ('ptype', 'content');
adFactory.setParam ('!category', 'expandables');
</script>
Converting Standard Ads to Iframe
• Iframe
<script type="text/javascript">
iframeAdFactory.queryString =
'TiiAdConfig=3475.golf&adConfigPairs=' +
encodeURIComponent('setCmSitename=cm.golf&setRevSciTrackin
g=true')+ '&TiiAdFactory=' +
encodeURIComponent('tours_news/leaderboards') +
'&adFactoryPairs=' + encodeURIComponent('setChannel=tours-
news&setSubchannel=leaderboard&setChannelPage=') +
'&paramPairs=' + encodeURIComponent('ptype=content&!
category=expandables');
iframeAdFactory.url = '[url path]/iframe.html';
iframeAdFactory.quigoUrl = '[url path]/iframe_quigo.html';
</script>
Converting Standard Ads to Iframe
• Iframe
iframeAdFactory.getAd = function (id, width,
height, sizes, isMaster, getAsInnerHTML,
hookContainer)
iframeAdFactory.getQuigoAd = function
(pid, placementId, zw, zh, ps,
getAsInnerHTML)
Converting Standard Ads to Iframe
• Standard Ad Call
adFactory.getAd(728, 90).write();
• Iframe Ad Call
iframeAdFactory.getAd('i_728x90', 728, 90);
Converting Standard Ads to Iframe
• Standard “Master” Ad Call
adFactory.getAd(1, 1).write();
• Iframe “Master” Ad Call
iframeAdFactory.getAd('i_1x1', 1, 1, false,
true);
Converting Standard Ads to Iframe
• Standard Multi-Ad Call
adFactory.getMultiAd(new Array("300x250",
"300x600")).write();
• Iframe Multi-Ad Call (dynamically resizes)
iframeAdFactory.getAd('i_300x250', 300, 250, new
Array ('300x250', '300x600'));
Converting Standard Ads to Iframe
• Standard Consumer Marketing ad call
adFactory.getCmAd(300, 100, "global",
"tout").write();
• Iframe ad version – currently not
supported (no apparent need as yet)
Converting Standard Ads to Iframe
• Attach the iframe ad as innerHTML to div (where
div element is created dynamically, such as in
Golf.com leaderboard)
iframeAdFactory.getAd('i_640x50', 640, 50, false,
false, true, div);
• Quigo ad call (same for both standard and
iframe)
tiiQuigoWriteAd(777767, 1369746, 300, 225, -1);
Appendix. URLs and Templates
• Parent Page URLs (in order)
– jQuery
• Website’s domain-specific url for now
– tii_ads.js
• TIPS: http://img4.yourdomain.com/static/j/ext/tii_ads.js
• V6 and V5: http://img.timeinc.net/shared/static/js/tii_ads.js
– iframeAdFactory
• http://img2.timeinc.net/shared/static/js/timeinc/iframe_ad_factory.js
Appendix. URLs and Templates
• Standard Iframe Page URLs (in order)
– tii_ads.js
• TIPS:
http://img4.yourdomain.com/static/j/ext/tii_ads.js
• V6 and V5: http://
img.timeinc.net/shared/static/js/tii_ads.js
– iframeAd
• http://img2.timeinc.net/shared/static/js/timeinc/iframe_ad
Appendix. URLs and Templates
• Quigo Iframe Page URLs (in order)
– Quigo
• http://js.adsonar.com/js/tw_adsonar.js
– iframeAd
• http://img2.timeinc.net/shared/static/js/timeinc/iframe_ad
Appendix. URLs and Templates
• Templates
– Standard iframe ad
• https://frontend-
open.collabnet.timeinc.net/source/browse/frontend-
open/branches/test/ad_synching/iframe.html?view=log
– Quigo iframe ad
• https://frontend-
open.collabnet.timeinc.net/source/browse/frontend-
open/branches/test/ad_synching/iframe_quigo.html?view=log
Questions?
Willi Gamboa
Senior Web Developer
Front End Development Team
Time Inc

Mais conteúdo relacionado

Semelhante a Dynamic Ad Refresh and Synching

Broadstreet quickstart-mar11-1
Broadstreet quickstart-mar11-1Broadstreet quickstart-mar11-1
Broadstreet quickstart-mar11-1
Mary Barr Mann
 

Semelhante a Dynamic Ad Refresh and Synching (20)

The Power of Amazon EC2 Spot Instances Best Practices and Real-World Use Cases
The Power of Amazon EC2 Spot Instances Best Practices and Real-World Use CasesThe Power of Amazon EC2 Spot Instances Best Practices and Real-World Use Cases
The Power of Amazon EC2 Spot Instances Best Practices and Real-World Use Cases
 
Uploading HTML5 ads
Uploading HTML5 adsUploading HTML5 ads
Uploading HTML5 ads
 
Your easy move to serverless computing and radically simplified data processing
Your easy move to serverless computing and radically simplified data processingYour easy move to serverless computing and radically simplified data processing
Your easy move to serverless computing and radically simplified data processing
 
EVOLVE'13 | Enhance | Ecommerce Framework | Paolo Mottadelli
EVOLVE'13 | Enhance | Ecommerce Framework | Paolo MottadelliEVOLVE'13 | Enhance | Ecommerce Framework | Paolo Mottadelli
EVOLVE'13 | Enhance | Ecommerce Framework | Paolo Mottadelli
 
Evolve13 cq-commerce-framework
Evolve13 cq-commerce-frameworkEvolve13 cq-commerce-framework
Evolve13 cq-commerce-framework
 
コードの脆弱性の恐怖と対応
コードの脆弱性の恐怖と対応コードの脆弱性の恐怖と対応
コードの脆弱性の恐怖と対応
 
Ui dev@naukri-2011
Ui dev@naukri-2011Ui dev@naukri-2011
Ui dev@naukri-2011
 
Pass back-tags by-Sajid Dongarkar
Pass back-tags by-Sajid DongarkarPass back-tags by-Sajid Dongarkar
Pass back-tags by-Sajid Dongarkar
 
New Features Coming in Browsers (RIT '09)
New Features Coming in Browsers (RIT '09)New Features Coming in Browsers (RIT '09)
New Features Coming in Browsers (RIT '09)
 
Building a Headless Shop
Building a Headless ShopBuilding a Headless Shop
Building a Headless Shop
 
JAX-RS 2.0 New Features
JAX-RS 2.0 New FeaturesJAX-RS 2.0 New Features
JAX-RS 2.0 New Features
 
HostBridge Blue Prism mainframe automation
HostBridge Blue Prism mainframe automationHostBridge Blue Prism mainframe automation
HostBridge Blue Prism mainframe automation
 
AWS Customer Presentation - AdCamo
AWS Customer Presentation - AdCamoAWS Customer Presentation - AdCamo
AWS Customer Presentation - AdCamo
 
WordPress Just A Blogging CMS - Emir Brkic
WordPress Just A Blogging CMS - Emir BrkicWordPress Just A Blogging CMS - Emir Brkic
WordPress Just A Blogging CMS - Emir Brkic
 
Broadstreet quickstart-mar11-1
Broadstreet quickstart-mar11-1Broadstreet quickstart-mar11-1
Broadstreet quickstart-mar11-1
 
Shopify
ShopifyShopify
Shopify
 
AEM & eCommerce integration
AEM & eCommerce integrationAEM & eCommerce integration
AEM & eCommerce integration
 
Disaster Recovery Using Azure Services
Disaster Recovery Using Azure ServicesDisaster Recovery Using Azure Services
Disaster Recovery Using Azure Services
 
Disaster Recovery using Azure Services
Disaster Recovery using Azure ServicesDisaster Recovery using Azure Services
Disaster Recovery using Azure Services
 
Marketing Automation with dotCMS
Marketing Automation with dotCMSMarketing Automation with dotCMS
Marketing Automation with dotCMS
 

Dynamic Ad Refresh and Synching

  • 1. Dynamic Ad Refresh and Synching (Real Simple and Golf) July 15, 2009 IT Watercooler Meeting v2: June 22, 2010
  • 2. Business Requirements • Refresh ads without refreshing the whole page • Each refresh = new ad impressions • Optional: ad synchronization
  • 3. Problem • Ads call document.write () to be attached to the page • document.write () after page load = blank page • Trying to refresh ads on page = blank page
  • 4. Solution • Use iframes and pass ad parameters: iframe.src = ‘iframead.html? TiiAdConfig=3475.rsm&…’; • Each iframe points to the same “ad loader” page but loads a different ad • To refresh an ad, make a new call: iframe.src = ‘iframead.html?...’;
  • 5. Synchronization • Pass the same random “ord” parameter value to each iframe ad • Pass a different “tileCounter” number • A “master” iframe ad needs to load first • It needs to finish loading before the next iframe ad loads
  • 6. Queuing Ad Calls • Each initial iframe ad call gets placed into a queue • One iframe ad call is designated as the “master” (need not be the first one on the page, but there always has to be a “master”) • Upon completed page load: the “master” call is made first • Upon completed load of the “master” ad iframe, the rest of the iframe ad calls are made
  • 7. Required JavaScript Libraries • jQuery or TIMEINC library • TiiAd libraries (tii_ads.js) – global ad libraries for Time Inc websites • iframeAdFactory • iframeAd
  • 8. Samples • Real Simple http://cp.timeinc.net:8080/tii/frontend/realsimple/ • Golf http://www.golf.com/golf/tours_news/leaderboard • Soon to be on ThisOldHouse.com • Can be ported to any website that uses the TiiAd libraries (tii_ads.js) • Real Simple http://cp.timeinc.net:8080/tii/frontend/realsimple/l • Golf http://www.golf.com/golf/tours_news/leaderboard • Soon to be on ThisOldHouse.com • Can be ported to any website that uses the TiiAd libraries (tii_ads.js) • Real Simple http://cp.timeinc.net:8080/tii/frontend/realsim ple/lotus/test/ad_refresh.html • Golf http://www.golf.com/golf/tours_news/leaderb oard/0,28360,,00.html • Soon to be on ThisOldHouse.com • Can be ported to any website that uses the TiiAd libraries (tii_ads.js)
  • 9. Test It! • In the browser address bar, enter: – Synchronized javascript:iframeAdFactory.refresh () – Unsynchronized javascript:iframeAdFactory.refresh (true) – Note: iframeAdFactory.refresh () is the function that the JavaScript or SWF code needs to call to make a synchronized refresh
  • 10. Converting Standard Ads to Iframe • Standard <script type="text/javascript"> var adConfig = new TiiAdConfig("3475.golf"); adConfig.setCmSitename("cm.golf"); adConfig.setRevSciTracking(true); var adFactory = new TiiAdFactory(adConfig, "tours_news/leaderboards"); adFactory.setChannel("tours-news"); adFactory.setSubchannel("leaderboard"); adFactory.setChannelPage(); adFactory.setParam ('ptype', 'content'); adFactory.setParam ('!category', 'expandables'); </script>
  • 11. Converting Standard Ads to Iframe • Iframe <script type="text/javascript"> iframeAdFactory.queryString = 'TiiAdConfig=3475.golf&adConfigPairs=' + encodeURIComponent('setCmSitename=cm.golf&setRevSciTrackin g=true')+ '&TiiAdFactory=' + encodeURIComponent('tours_news/leaderboards') + '&adFactoryPairs=' + encodeURIComponent('setChannel=tours- news&setSubchannel=leaderboard&setChannelPage=') + '&paramPairs=' + encodeURIComponent('ptype=content&! category=expandables'); iframeAdFactory.url = '[url path]/iframe.html'; iframeAdFactory.quigoUrl = '[url path]/iframe_quigo.html'; </script>
  • 12. Converting Standard Ads to Iframe • Iframe iframeAdFactory.getAd = function (id, width, height, sizes, isMaster, getAsInnerHTML, hookContainer) iframeAdFactory.getQuigoAd = function (pid, placementId, zw, zh, ps, getAsInnerHTML)
  • 13. Converting Standard Ads to Iframe • Standard Ad Call adFactory.getAd(728, 90).write(); • Iframe Ad Call iframeAdFactory.getAd('i_728x90', 728, 90);
  • 14. Converting Standard Ads to Iframe • Standard “Master” Ad Call adFactory.getAd(1, 1).write(); • Iframe “Master” Ad Call iframeAdFactory.getAd('i_1x1', 1, 1, false, true);
  • 15. Converting Standard Ads to Iframe • Standard Multi-Ad Call adFactory.getMultiAd(new Array("300x250", "300x600")).write(); • Iframe Multi-Ad Call (dynamically resizes) iframeAdFactory.getAd('i_300x250', 300, 250, new Array ('300x250', '300x600'));
  • 16. Converting Standard Ads to Iframe • Standard Consumer Marketing ad call adFactory.getCmAd(300, 100, "global", "tout").write(); • Iframe ad version – currently not supported (no apparent need as yet)
  • 17. Converting Standard Ads to Iframe • Attach the iframe ad as innerHTML to div (where div element is created dynamically, such as in Golf.com leaderboard) iframeAdFactory.getAd('i_640x50', 640, 50, false, false, true, div); • Quigo ad call (same for both standard and iframe) tiiQuigoWriteAd(777767, 1369746, 300, 225, -1);
  • 18. Appendix. URLs and Templates • Parent Page URLs (in order) – jQuery • Website’s domain-specific url for now – tii_ads.js • TIPS: http://img4.yourdomain.com/static/j/ext/tii_ads.js • V6 and V5: http://img.timeinc.net/shared/static/js/tii_ads.js – iframeAdFactory • http://img2.timeinc.net/shared/static/js/timeinc/iframe_ad_factory.js
  • 19. Appendix. URLs and Templates • Standard Iframe Page URLs (in order) – tii_ads.js • TIPS: http://img4.yourdomain.com/static/j/ext/tii_ads.js • V6 and V5: http:// img.timeinc.net/shared/static/js/tii_ads.js – iframeAd • http://img2.timeinc.net/shared/static/js/timeinc/iframe_ad
  • 20. Appendix. URLs and Templates • Quigo Iframe Page URLs (in order) – Quigo • http://js.adsonar.com/js/tw_adsonar.js – iframeAd • http://img2.timeinc.net/shared/static/js/timeinc/iframe_ad
  • 21. Appendix. URLs and Templates • Templates – Standard iframe ad • https://frontend- open.collabnet.timeinc.net/source/browse/frontend- open/branches/test/ad_synching/iframe.html?view=log – Quigo iframe ad • https://frontend- open.collabnet.timeinc.net/source/browse/frontend- open/branches/test/ad_synching/iframe_quigo.html?view=log
  • 22. Questions? Willi Gamboa Senior Web Developer Front End Development Team Time Inc