Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
renojim
Community Streaming Expert

Bug in RAF or problem with VAST returned by ad provider?

I've been noticing a bunch of [RAF.err] messages in the console when my game requests an ad and I don't know who to blame. 🙂  

The error is something like this:
[RAF.err] roUrlTransfer.setURL("http://(some domain)/vast2?adtype=video&compMode=and&dim=101&z=1r&w=1920&h=1080&ip=ROKU_ADS_EXTERNAL_IP&ajuseragent=Roku/DVP-9.10 (049.10E04111A)") rejected argument - invalid chars? (space and "<>\^`{|} must be %-encoded)


The URL is coming from the VAST tag returned from the original request that's something like:
http://adserver.com/serve/?tag=1234&ua=Roku%2FDVP-9.10%20%28049.10E04111A%29&appid=dev&width=1280&ip=ROKU_ADS_EXTERNAL_IP&dnt=1&height=720&rnd=691954574


So the User Agent is the problem.  It's %-encoded in the initial request, but not in the VAST tag URL.  So which end is responsible for %-encoding things before the second request to the URL in the VAST tag?

I can get around it by just setting the User Agent in the adUrl I give to RAF to something like Roku/DVP, but that seems like a bit of a hack.  I'm not sure if it's even necessary to include the ua parameter at all, so maybe just removing it is the answer.

For extra credit, why doesn't ROKU_ADS_EXTERNAL_IP get populated?  🙂

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
3 REPLIES 3
RokuNB
Roku Guru

Re: Bug in RAF or problem with VAST returned by ad provider?

regarding ROKU_ADS_EXTERNAL_IP - this is tricky but i think i know the answer! i believe you have LAT selected (limit ad tracking) in Settings > Privacy - that's one of intended results.

the other thing i'll have to guess if i understood you - seems that 1st URL you gave was returned as part of calling first the 2nd URL? i.e. returned VAST had a wrapper pointing to a new URL. Well in that case, this is clearly a problem of that ad server (#2 URL) - they have returned invalid URL:
http://(some domain)/vast2?adtype=video&compMode=and&dim=101&z=1r&w=1920&h=1080&ip=ROKU_ADS_EXTERNAL_IP&ajuseragent=Roku/DVP-9.10 (049.10E04111A)

clue: unescaped space chars are never OK in URL (should be %20 or +)

i figure that ad server is using the value that was correctly escaped (by RAF macro &ua=ROKU_ADS_USER_AGENT or you) but when they substituted it in XML, they did not escape it
0 Kudos
renojim
Community Streaming Expert

Re: Bug in RAF or problem with VAST returned by ad provider?

"RokuNB" wrote:
regarding ROKU_ADS_EXTERNAL_IP - this is tricky but i think i know the answer! i believe you have LAT selected (limit ad tracking) in Settings > Privacy - that's one of intended results.

Yep, that's probably it!

"RokuNB" wrote:
i figure that ad server is using the value that was correctly escaped (by RAF macro &ua=ROKU_ADS_USER_AGENT or you) but when they substituted it in XML, they did not escape it

Right, that's what it looks like.  My problem is that getting the ad server to fix it probably isn't likely, so I'm missing an opportunity this ad break.  I see the same thing occasionally with other parameters that aren't correctly escaped.  It would be nice if when RAF detects a problem with a URL it automatically fixed such a simple thing.  Or, maybe have a callback and give my code a chance to fix it.

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
gomad
Roku Guru

Re: Bug in RAF or problem with VAST returned by ad provider?

We had a similar problem, had the adservers fix the response, as RAF started following this mid jun or something this year. 

But i agree with you there should be an error thrown for these kinda errors from RAF, easier to capture during testing itself.

0 Kudos