Re: Issue of inject MRAID Js to creatives.

541 views
Skip to first unread message

Amit Raut

unread,
Jun 13, 2013, 4:23:32 PM6/13/13
to ormma-di...@googlegroups.com
HI All,

I have below mraid tag which is not working for me. Actually when I have upload this tag in our ad server, I am not able to preview the creative.

<script src="mraid.js"></script>
<div class="celtra-ad-v3">
    <img src="data:image/png,celtra" style="display: none" onerror="
        (function(img) {
            var params = {'channelId':'2336fe57','clickUrl':'%c','externalAdServer':'Custom'};
            var req = document.createElement('script');
            req.id = params.scriptId = 'celtra-script-' + (window.celtraScriptIndex = (window.celtraScriptIndex||0)+1);
            params.clientTimestamp = new Date/1000;
            req.src = (window.location.protocol == 'https:' ? 'https' : 'http') + '://ads.celtra.com/8936e3a5/mraid-ad.js?';
            for (var k in params) {
                req.src += '&amp;' + encodeURIComponent(k) + '=' + encodeURIComponent(params[k]);
            }
            img.parentNode.insertBefore(req, img.nextSibling);
        })(this);
    "/>
</div>

Cab anybody help me?

Thanks,
Amit Raut

On Thursday, 27 December 2012 13:42:09 UTC+5:30, Yan Bai wrote:
Hi All,

I am working on MRAID SDK now. There is a problem on my side:

We know that SDK should provide mraid object and some necessary methods such as getState and addEventListener ASAP. So that means the mraid js should be injected into WebView before creative loaded.

After investigate ORMMA reference SDK and Mocean SDK, I see that they download the creative, insert <script src="mraidJsPath"></script> to the head of creative then load it.

Is this the only way to do that?

I tried following code on Android but failed:

mWebView.getSettings().setEnableJavascript(true);
mWebView.loadUrl("javascript:" + mraidJSString);
mWebView.loadUrl(creativePath);

--Yan

Jurij Vidmar

unread,
Jun 14, 2013, 1:08:12 PM6/14/13
to ormma-di...@googlegroups.com
Which ad server and SDK are you using? Also, are there any errors in the JS console?

Jurij

Stavros Natsios

unread,
Dec 6, 2013, 6:14:57 AM12/6/13
to ormma-di...@googlegroups.com
Hi Amit,

did you manage to get it working? And if yes could you post how you did it?

Thanks

Stavros
Reply all
Reply to author
Forward
0 new messages