Blocked with " Ad Error Msg: Unable to request ads from server due to network error. Error code =AdErrorCode [name: ADS_REQUEST_NETWORK_ERROR, number: 1012]"after IMA sdk integration to serve DFP ads - Kindly help

576 views
Skip to first unread message

B Monika

unread,
Nov 16, 2016, 8:42:50 AM11/16/16
to Interactive Media Ads SDK
Hi ,

We are trying to serve video ads from DFP in our Android media player application that is using default native player.As part of this effort we have integrated IMA sdk 3.2.1 and google play services ads 7.8.0 

Issue:
We are sending ad request as follows.
Actual Ad URL :
%REFERRER_URL_ESC_ESC%%&description_url=%%DESCRIPTION_URL_ESC_ESC%%&correlator=%%CACHEBUSTER%%

Code Snippet

mPrerollTagUrl = Uri.encode(mPrerollTagUrl);
Log.d("ADS","********* AdTagUrl after encode "+mPrerollTagUrl);
request.setAdTagUrl(mPrerollTagUrl);
request.setAdDisplayContainer(mAdDisplayContainer);
mAdsLoader.requestAds(request);
URL after encode is as mentioned below :

https%3A%2F%2Fpubads.g.doubleclick.net%2Fgampad%2Fads%3Fsz%3D400x300%26iu%3D%2F32848038%2Fsupport-test%26impl
%3Ds%26gdfp_req%3D1%26env%3Dvp%26output%3Dvast%26unviewed_position_start%3D1%26url%3D
%25%25REFERRER_URL_ESC_ESC%25%25%26description_url%3D%25%25DESCRIPTION_URL_ESC_ESC%25%25%26correlator%3D
%25%25CACHEBUSTER%25%25 

After using encode on actual ad tag url, we are seeing below error
Ad Error Msg: Unable to request ads from server due to network error. Error code =AdErrorCode [name: 
ADS_REQUEST_NETWORK_ERROR, number: 1012]

If we are not performing encode on ad url, we see no response received or no errors reported from sdk also

The actual adurl is generated from my dfp account created.
We are not able to reproduce the issue in VAST inspector.
We are able to reproduce the issue in Sample player when we used the above url
We are able to load this adtag url in browser
We have even tried in other players like JW player etc and we could see our ad being served.
We tried to play the VAST url that comes with Sample Player in native player which is used in our app.It played fine without any issue.

One of the blogs (https://groups.google.com/forum/#!msg/ima-sdk/lFijZHHo000/TcBn99DsQPgJ ) mention this network issue to be related to CORS and so mentioned to add headers Access-Control-Allow-Orgin to */domain name and Credentials flag to false 

But we are not sure how to append these headers for the adrequest being sent
I don't see any apis for adding headers to IMA sdk request.
Tried to add these as extra parameters for the request but of no use.

We used charles proxy to check the response of this hit .We could see 404 error

http://imasdk.googleapis.com/native/sdkloader/ is getting appended before Ad tag url

%3D400x300%7C640x480%26iu%3D%2F32848038%2Fsample%26impl%3Ds%26gdfp_req%3D1%26env%3Dvp%26output%3Dvast
%26unviewed_position_start%3D1%26url%3D%25%25REFERRER_URL_ESC_ESC%25%25%26description_url%3D
%25%25DESCRIPTION_URL_ESC_ESC%25%25%26correlator%3D%25%25CACHEBUSTER%25%25

From where is this getting appended and is this an issue or expected behaviour?Please suggest.

Now in the log snippet I provided as part of the attachment, I see below error
Could you please check the log and let me know if this is log harmful that is blocking from ad to be served or can this be ignored

Log:

11-16 17:19:42.582  25436-25436/com.vodacom.aptv E/dalvikvm﹕ Could not find class 
'android.support.v4.util.ArrayMap', referenced from method com.google.ads.interactivemedia.v3.impl.x.f
......
.....
11-16 17:19:44.139 E/Web Console(25436): Uncaught URIError: URI malformed at


Kindly help me on this and provide some inputs on proceeding further.


adReq.txt

Vu Chau (IMA SDK Team)

unread,
Nov 16, 2016, 2:33:49 PM11/16/16
to Interactive Media Ads SDK
Hello,

Thanks for getting in touch.  For the Android SDK, you will want to double-encode your ad tag, so that instead of "%25", you will want it to be "%2525".  The Android SDK double-decodes this, as opposed to the HTML5 SDK.

Your final ad tag should look like the following:
https://pubads.g.doubleclick.net/gampad/ads?sz=400x300|640x480&iu=/32848038/sample&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&url=%2525%2525REFERRER_URL_ESC_ESC%2525%2525&description_url=%2525%2525DESCRIPTION_URL_ESC_ESC%2525%2525&correlator=%2525%2525CACHEBUSTER%2525%2525
The team will explore options on what we can do regarding this.

Vu Chau
IMA SDK Team

B Monika

unread,
Nov 17, 2016, 11:17:58 AM11/17/16
to Interactive Media Ads SDK
Thank-you very much Vu Chau for your reply.Now am able to see ad being served in my player
Reply all
Reply to author
Forward
0 new messages