delete-me Posted June 3, 2014 Report Share Posted June 3, 2014 digitaladapt could you post the example code of how you are calling this code. Thanks ReferenceError: data is not defined parent.appendChild(el); writeCapture2.js (line 260) The last two lines of javascript got truncated in my post (I've gone back and corrected it). Here is a complete example: <!DOCTYPE html> <html> <head> <script src="/path/to/element.write.js"></script> <script src="/path/to/writeCapture2.js"></script> <title>Async Ad Test</title> </head> <body> <div id="AdPlaceholder"> <!-- ad will go here --> </div> <script> /* this function wrapper keeps global memory space clear of random variables */ (function(){ writeCapture.write( document.getElementById("AdPlaceholder"), '<scr' + 'ipt>' + 'var oxSrc = (document.location.protocol === "https:" ? "https:" : "http:")' + '+ "//example.com/ReviveAdServer/www/delivery/ajs.php"' + '+ "?zoneid=123&block=1&blockcampaign=1&cb=" + Math.floor(Math.random()*99999999999)' + '+ "&charset=UTF-8&loc=" + encodeURIComponent(window.location)' + '+ (document.MAX_used !== "," ? ("&exclude=" + document.MAX_used) : "")' + '+ (document.referrer ? ("&referer=" + encodeURIComponent(document.referrer)) : "")' + '+ (document.context ? ("&context=" + encodeURIComponent(document.context)) : "")' + '+ (document.mmm_fo ? "&mmm_fo=1" : "");' + 'document.write("<scr" + "ipt src=\'" + oxSrc + "\'></scr" + "ipt>");' + '</scr' + 'ipt>' ); })(); </script> </body> </html> Here is a simple real-world working example: http://constructionjobs.com/test.php Quote Link to comment Share on other sites More sharing options...
andrewatfornax Posted June 3, 2014 Report Share Posted June 3, 2014 The main theme for wanting async loading of ad's is to increase page load speed, and not have the ad's block the loading of the main content. With google now rating the site on speed + content now slow page loads will kill google page rateings. Ive worked around my issue for now with using the iframe code and using jquery.load to call the ad iframe. Thanks for the input. I would argue that page load speed shouldn't be an issue if Revive Adserver is installed on something with appropriate power (i.e. you don't get speed for free!) and that you can avoid blocking loading of the main content with bottom loading JS + CSS positioning -- but I certainly understand the point. Glad you have a work around for now, and I'll certainly be having a chat with the Revive team about if we feel this is something we can take on to develop. I've been monitoring the progress of this thread since I posted it and I still believe Asynchronous loading should be a top priority and is vital to speeding page load speeds. And if Revive wants to be at the forefront of ad servers (which it should be), it needs to be built in. Thanks also for confirmation of the same theme above - seems to be important for people to allow main content to load first, and allow ads to load later when their Revive Adserver isn't so fast, as well as being easy to do without even something as relatively simple as bottom loading JS + CSS. It's definitely on my radar (if not definitely something I'm committing time to yet, because I really want to keep working on the documentation for a while to come for now.) Last thought from me would be that if Revive Adserver is going to be at the forefront of ad servers, then we're going to need a great community to help us progress, because we won't be able to do it without that! Thanks, Andrew Quote Link to comment Share on other sites More sharing options...
~AR Posted June 3, 2014 Author Report Share Posted June 3, 2014 ... Thanks also for confirmation of the same theme above - seems to be important for people to allow main content to load first, and allow ads to load later when their Revive Adserver isn't so fast, as well as being easy to do without even something as relatively simple as bottom loading JS + CSS. It's definitely on my radar (if not definitely something I'm committing time to yet, because I really want to keep working on the documentation for a while to come for now.) Last thought from me would be that if Revive Adserver is going to be at the forefront of ad servers, then we're going to need a great community to help us progress, because we won't be able to do it without that! Thanks, Andrew Andrew, could you post a documentation as to deploying a JS + CSS that would be the "Revive Recommended Version" for an intermediary fix? A Step-by-step guide we ALL use when confronted with the issue, so all Revive users are working off the same solution. That would allow for better bug reports, trouble shooting, etc. Because right now it is fragmented, everyone is using a different solution and there is no common ground on the matter, so no real forward progress can be made. I see that as an in between step that would still allow functionality in the current release, while development progresses on a true async solution. Quote Link to comment Share on other sites More sharing options...
andrewatfornax Posted June 4, 2014 Report Share Posted June 4, 2014 I wrote this up in 2009, but it still seems roughly right: http://www.openxtips.com/2009/07/tip-20-protect-your-site-from-openx-hangs/ It doesn't go into a lot of detail about how to position with CSS, as I felt at the time that was beyond the scope of what I needed to tell people about... Is that sufficient for now? Quote Link to comment Share on other sites More sharing options...
andrewatfornax Posted July 16, 2014 Report Share Posted July 16, 2014 Anyone who wants this want to create a feature request in GitHub, please, describing what it should do / why it's required? Thinking we might aim to do this for 3.1.0 if we can. Thanks. xtech 1 Quote Link to comment Share on other sites More sharing options...
xtech Posted July 19, 2014 Report Share Posted July 19, 2014 Hi andrewatfornax, it would be really nice. I think the main feature would be: - Allow async loading of banners/etc without them repeating at the same page Why it is required: - Speed reasons: content and page could be loaded faster. From my experience with other ad servers, async ad sites load faster, and that increases usability quality, higher ranks in search engines. Definitely, async loading would be my personal top feature. Quote Link to comment Share on other sites More sharing options...
gabrielt Posted July 25, 2014 Report Share Posted July 25, 2014 My main issue is with the rendering of our website. When banners are stored locally, everything loads ultra fast. But when we have ad network banners, where network latency is added, the delay in loading the banners makes our page to load extremely slow, as the <div> tag won't render until the image is loaded. Tried several different approaches, and so far I haven't come to a solution. If you want to help me, my website is http://www.clubedohardware.com.br Quote Link to comment Share on other sites More sharing options...
gabrielt Posted July 28, 2014 Report Share Posted July 28, 2014 Just for my own sanity, though - given the complexity of async loading, and as Erik has mentioned, the risks it introduces in terms of cross-browser compatibility - why is it so important to you all (i.e. those +1ing above)? Why would async loading be any better than, say, putting your standard JS tags at the bottom of the page with appropriate CSS to position them? The link you posted is broken. I spent today the whole day playing with this idea. The problem here is that it only works with banners stored on our own servers. For some reason, banners coming from ad networks display blank, as if they somehow knew that we are trying to move/manipulate the banner. Maybe there is a better way to implement this idea than the one I was trying. Tips on this are welcome. I use single-page call, so I was playing with the OA_show(); part. Examples other people posted are not for single-page calls, so I got lost on that particular discussion. Thanks. Quote Link to comment Share on other sites More sharing options...
gorman Posted August 25, 2014 Report Share Posted August 25, 2014 I'm not expert in JS, but I use very simple method, even without jquery. And it work fine for text, html, and other ad system code banners. in the real slot I put only div: <div id="OA_show_7"></div> then single load config <script type='text/javascript'><!--// <![CDATA[ var OA_zones = { 'my_zone_name' : 7 } // ]]> --></script> at the bottom of pages, avoid delay main content rendering //initial request: <script type='text/javascript' src='http://AD.SERVER>NAME/id=1&charset=UTF-8'></script> //insert banner code in hidden div <div id="OA_container_zone_7" style="display:none;"> <script type='text/javascript'> OA_show('my_zone_name'); </script> </div> //copy rendered code to real, visible slot <script language="JavaScript"> function g_e(el) {return document.getElementById(el);} if (g_e('OA_show_7')) g_e('OA_show_7').innerHTML=g_e('OA_container_zone_7').innerHTML; </script> Quote Link to comment Share on other sites More sharing options...
gabrielt Posted August 25, 2014 Report Share Posted August 25, 2014 Thanks a lot, gorman, I will try this! Quote Link to comment Share on other sites More sharing options...
andrewatfornax Posted August 27, 2014 Report Share Posted August 27, 2014 The link you posted is broken. Apologies, DNS got messed up in domain transfer. Fixed now, should propagate out over the next few hours. Quote Link to comment Share on other sites More sharing options...
gabrielt Posted September 5, 2014 Report Share Posted September 5, 2014 Hi gorman, Thanks for the code. The problem is that it doesn't work with ad networks, at least with the ones I am using. They detect we are trying to load the banner on a hidden <div> and the banner isn't loaded. I believe this is a feature to avoid people loading hidden banners on a page without the intention to show them. See my post #33 above. Thanks, Gabriel. Quote Link to comment Share on other sites More sharing options...
gabrielt Posted September 5, 2014 Report Share Posted September 5, 2014 andrewatfornax, your tip actually works (End place tags & position with CSS). The problem is how to guess the positioning if we don't know the user's resolution, etc. I am playing with it right now, I am sure it must have an easy solution for that. Thanks. I am figuring out that the problem is not with Revive itself, but with RTB ad networks that have a huge lag loading the banner, so everything is stuck until the banner is load. So, I don't think "fixing" Revive's code will fix this, as the issue is with the ad network code/banner loading... :/ Quote Link to comment Share on other sites More sharing options...
gorman Posted September 12, 2014 Report Share Posted September 12, 2014 The problem is that it doesn't work with ad networks, at least with the ones I am using. Yes ( And another one: it may cause for double impressions. For one od external ad system I catch that it loaded twice, first on hidden div, and second on real Quote Link to comment Share on other sites More sharing options...
Moshe L Posted September 14, 2014 Report Share Posted September 14, 2014 look of what I was wrote (www.inn.co.il, hit F12 and then write "Info"). I am collecting banner info (ID of DIV, and zone) in JS and load & count all the banners in the same request. This code works in the client perefectly, but the serverside is ugly so I could not contribute it. Quote Link to comment Share on other sites More sharing options...
middir Posted November 20, 2014 Report Share Posted November 20, 2014 Hey guys, just wanted to push this topic as I still think it's a major update. As I said in my previous post it seems that the guys from openx managed to do it : http://docs.openx.com/ad_server/adtagguide_asynchjs.html I would love to contribute, I made so many test but all of them had their cons so not suitable really. Anyone managed to find a work around for generating asynchronous loading?? If the Openx team managed to do it it seems that it should be do-able for revive too Feedback welcome. Cheers, Quote Link to comment Share on other sites More sharing options...
diadyo Posted January 5, 2015 Report Share Posted January 5, 2015 Hello, we would really like the feature also. We've tried a few ways but none of them really worked. We have a website that loads more than 20 banners on the homepage (long homepage for a large local site). Right now we use iframe to asynchronous load banners but it takes a lot of resources and time to load everything - also firefox does not like it and seems to wait for each iframe to load before it goes to the next... still trying to figure out how to resolve this. Quote Link to comment Share on other sites More sharing options...
praveen Posted March 9, 2015 Report Share Posted March 9, 2015 Bumping this topic as this is a really must-have feature seeing big G is bent on speed.. Quote Link to comment Share on other sites More sharing options...
Matteo Beccati Posted March 9, 2015 Report Share Posted March 9, 2015 Stay tuned Richard Foley 1 Quote Link to comment Share on other sites More sharing options...
andrewatfornax Posted March 10, 2015 Report Share Posted March 10, 2015 Hah! You're a proper tease, Matteo! The core team hopes to have this out in the next release, which should come out as a beta, soon - all thanks to Matteo's hard work, and a generous sponsor.... Details will be announced when it's ready! Quote Link to comment Share on other sites More sharing options...
praveen Posted March 17, 2015 Report Share Posted March 17, 2015 Brilliant... Thanks Guys Quote Link to comment Share on other sites More sharing options...
andrewatfornax Posted April 28, 2015 Report Share Posted April 28, 2015 And indeed, Revive Adserver 3.2.0 has now been released, which includes native asynchronous tag support. Richard Foley and gabrielt 2 Quote Link to comment Share on other sites More sharing options...
gabrielt Posted April 29, 2015 Report Share Posted April 29, 2015 Oh, yeah, baby! Quote Link to comment Share on other sites More sharing options...
gabrielt Posted April 29, 2015 Report Share Posted April 29, 2015 I see that the async loading code uses the following format: <!--/* * * Revive Adserver Asynchronous JS Tag * - Generated with Revive Adserver v3.2.0 * */--> <ins data-revive-zoneid="1" data-revive-id="7813b56809490348166b3701f410dbbc"></ins> <script async src="//xxxxxxxxx.com/www/delivery/asyncjs.php"></script> Quote Link to comment Share on other sites More sharing options...
gabrielt Posted April 29, 2015 Report Share Posted April 29, 2015 My question is whether the hash data-revive-id is fixed or varies according to the zoneid, and if it varies, how to calculate it? Because our CMS generate the tags inserting the zoneid according to the location the user is loading from our website. Thank you! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.