Custom parameter in adTagUrl

1,411 views
Skip to first unread message

Gourav goyal

unread,
Mar 17, 2020, 5:01:02 AM3/17/20
to Interactive Media Ads SDK
Hi 

How can i add custom parameters in adTagUrl ?
Do we need to pass custom Parameters while requesting ad?

I am implementing pre roll ads using ima client side implementation in android..

Thanks
Gourav Goyal

IMA SDK

unread,
Mar 17, 2020, 6:35:40 AM3/17/20
to gouravg...@gmail.com, ima...@googlegroups.com

Hi Gourav,

 

Thank you for reaching out to us. You can add custom parameters when you generate your ad tag via your Ad Manager account or by using cust_params keyword. You can refer to this documentation for more information. I would also suggest reaching out to your ad provider for further assistance with regard to adding custom parameters in ad tag URLs.

 

Regards,

Sherwin Diesta

IMA SDK Team



ref:_00D1U1174p._5001UXVIh2:ref

Sergio Martinez

unread,
Apr 21, 2020, 6:46:13 PM4/21/20
to Interactive Media Ads SDK
Hi,

I have a follow-up question.
I was looking at https://support.google.com/admanager/answer/7320899?hl=en and there it says in Android, the cust_params shouldn't be encoded, but in https://support.google.com/admanager/answer/1080597?hl=en&ref_topic=2480647 it says they should.

Should I rely on the latter link?
Does this mean we can only add cust_params in Android by appending &cust_params=<encodedKeyValuePairs> to the adTagUrl?

Thanks,
Sergio

IMA SDK

unread,
Apr 21, 2020, 11:04:23 PM4/21/20
to smar...@brightcove.com, ima...@googlegroups.com

Hi Sergio,



Thank you for reaching out to us.

If you're going to override a limited set of ad tag parameters on your stream request via the IMA SDK for Android then you should not url-encode the strings for cust_params. On the other hand, if you're going to add key-values to a master video ad tag in Ad Manager then you should use the encoded values for your cust_params.

I would suggest reaching out to your ad provider or you can visit the Google Ad Manager help center for further assistance regarding your concern.



Regards,
Sherwin Diesta
IMA SDK Team



ref:_00D1U1174p._5001UaRrKs:ref

Sergio Martinez

unread,
Apr 22, 2020, 12:25:55 AM4/22/20
to Interactive Media Ads SDK
Thanks for the prompt reply.

Do you have a sample code showing how to override the parameters vie IMA SDK for Android?

I enabled debug mode for ads following https://developers.google.com/interactive-media-ads/docs/sdks/android/v3/api/reference/com/google/ads/interactivemedia/v3/api/ImaSdkSettings and checking the ad request with Charles Proxy and I tried the following options:
1. adTag += "&cust_params=section=sports&
  multi=baseball,tennis":
This option would only show cust_params=section

2.  adsRequest.setExtraParameter("cust_params", "section=sports&
  multi=baseball,tennis")
That didn't add anything to the request (nor any other combination using that method)

3. adTag += "&cust_params=section%3Dsports%26%0A%20%20multi%3Dbaseball%2Ctennis"
Only this option with the values encoded were successfully shown in the request with the right values for cust_params.

Maybe the third option is not the proper way for overriding parameters in the IMA SDK. I would greatly appreciate if there's a different and recommended way to do that.

Thanks

IMA SDK

unread,
Apr 22, 2020, 4:14:12 AM4/22/20
to smar...@brightcove.com, ima...@googlegroups.com

Hi Sergio,

Thank you for your response and for sharing this information. I'm afraid, we do not have a sample code for testing at the moment.

However, based on the options that you've shared, the option #3 would be the best option to add key-values into your master video ad tag using the encoded values, as this will coincide with the recommendation in this Google Ad Manager documentation.

The non-encoded value is used for DAI IMA SDK for Android to override the cust_parameter through setAdTagParameters method during the stream request. The setExtraParameter on the other hand is not intended for overriding ad parameters, but instead for extra features within the SDK.



Regards,
Sherwin Diesta
IMA SDK Team



ref:_00D1U1174p._5001UaRrKs:ref

Sergio Martinez

unread,
Apr 22, 2020, 11:20:27 AM4/22/20
to Interactive Media Ads SDK
Thank you so much for this information, this is very useful!
Reply all
Reply to author
Forward
0 new messages