[PAID GIG] Help with SCRIPT Tag Rendering of Revive Ad Server Tags for Draft Plugin

Summary

Have created a draft of a revive ad server plugin based on a subset of code from the official discourse ad plugin. Basically, I removed the ad networks and refactored the house-ad code (all documented in the README) to serve tags from our revive ad server, filtering for either desktop or mobile ads (Revive does not support responsive tags yet). Here this the current redesign:

https://github.com/unixneo/neo-revive-discourse

Status:

  • Issue with rendering <script> tags (sync and async), but works fine with <iframe> tags

TODO:

  • Fix the issue rendering <script> tags <iframe> tags

Examples:

This iframe tag works fine:

<!-- Revive Adserver iFrame Tag - Generated with Revive Adserver v4.2.0 -->
<iframe id='a41d6e46' name='a41d6e46' src='http://srv.adserver.com/www/delivery/afr.php?zoneid=63&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='728' height='90'><a href='http://srv.adserver.com/www/delivery/ck.php?n=aa785d4b&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://srv.adserver.com/www/delivery/avw.php?zoneid=63&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=aa785d4b' border='0' alt='' /></a></iframe>

This async js tag will not render (this is the tag format we normally use):

<!-- Revive Adserver Asynchronous JS Tag - Generated with Revive Adserver v4.2.0 -->
<ins data-revive-zoneid="63" data-revive-id="2d220f1e3f63403189face1b493bcc4b"></ins>
<script async src="//srv.adserver.com/www/delivery/asyncjs.php"></script>

Likewise, this js tag will not render:

<!-- Revive Adserver Javascript Tag - Generated with Revive Adserver v4.2.0 -->
<script type='text/javascript'><!--//<![CDATA[
   var m3_u = (location.protocol=='https:'?'https://srv.adserver.com/www/delivery/ajs.php':'http://srv.adserver.com/www/delivery/ajs.php');
   var m3_r = Math.floor(Math.random()*99999999999);
   if (!document.MAX_used) document.MAX_used = ',';
   document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
   document.write ("?zoneid=63");
   document.write ('&amp;cb=' + m3_r);
   if (document.MAX_used != ',') document.write ("&amp;exclude=" + document.MAX_used);
   document.write (document.charset ? '&amp;charset='+document.charset : (document.characterSet ? '&amp;charset='+document.characterSet : ''));
   document.write ("&amp;loc=" + escape(window.location));
   if (document.referrer) document.write ("&amp;referer=" + escape(document.referrer));
   if (document.context) document.write ("&context=" + escape(document.context));
   if (document.mmm_fo) document.write ("&amp;mmm_fo=1");
   document.write ("'><\/scr"+"ipt>");
//]]>--></script><noscript><a href='http://srv.adserver.com/www/delivery/ck.php?n=aef496cd&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://srv.adserver.com/www/delivery/avw.php?zoneid=63&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=aef496cd' border='0' alt='' /></a></noscript>

Attempts to Fix:

Have tried htmlSafe() and triple handlebars, without success. I have no idea why only the iframe tag renders but the js tags will not render! Seems like an “emberjs” issue, which I don’t understand being a noob to Ember.js and Rails.

When do you need it done?

No hurry, we don’t plan to use this anytime soon; it is something I’m building for “the future”.

What is your budget, in $USD that you can offer for this task?

All reasonable offers to get me past this Ember.js rendering brick wall, are appreciated and welcome.

Notes:

For those interested, I don’t use DFP. Simply don’t like it. Revive works fine for us (self-hosting) but when this solution works, should work fine with DFP and other ad server tags as well, so the source code will remain freely available to all who might have a similar requirement.

Testing site (temporary for testing only):

Test site removed.

1 Like

This GIG is complete:

Success was accomplished by adding the external script to the theme header directly with some JS, like this:

<script>
    var js_script = document.createElement('script');
    js_script.type = "text/javascript";
    js_script.src = "https://srv.adserver.com/www/delivery/asyncjs.php";
    js_script.async = true;
    document.getElementsByTagName('head')[0].appendChild(js_script);
</script>

and then calling only this part of revive adserver tag, specifying the ad zone, in the plugin code, like this:

<div style='text-align: center;'>
<ins style='display:inline-block;' data-revive-zoneid="63" data-revive-id="2d220f1e3f63403189face1b493bcc4b"></ins>
</div>

Thanks!

PS: Could not find an Embers.js solution, as it seems from the Ember docs, handlebars does not accept <script> tags. May try to find a way to do this in Ember.js down the road…

8 Likes