implement ?Country={1}&AppId={0} in RemoteProviderSettingsUri

Apr 24, 2013 at 8:28 AM
Actually i'm building a service to serve the Unified Ad Control.

I'm trying to generate a xml file according to client's appid & country code. So one service could serve many apps and each app will receive a minimum xml file.

?Country={1}&AppId={0} is a great way but now only implemented only in GenericAdProvider. Why not implement it in RemoteAdProviderStrategy as well?

Now I 'patched' the code to get it running but it looks ugly. I'd like to see it's 'officially' implemented in a elegant way.

Great control btw.
Coordinator
Apr 25, 2013 at 7:25 AM
Hi,

I can understand if you would want to provide the AppId to the RemoteProviderSettingsUri. Though why would you want to provide Country as well? You can combine multiple country settings int the RemoteProviderSettings file.

Can you explain if you only want the AppId part or also the Country part?

Best,

Mark Monster
Apr 25, 2013 at 7:47 AM
Edited Apr 25, 2013 at 7:48 AM
I want both appid and country code.

I think the great advantage of your uad control is the flexibility to custom specific config for various scenarios.

I know we can combine multiple country code in one section. But I want to return to the client only the settings they'll actually use. No 'other country' sections will be returned.

Say this case:
<AdSettings xmlns="http://wpunifiedad.codeplex.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://wpunifiedad.codeplex.com UnifiedAd.xsd">
  <CountryDescriptors>
    <AdCountryDescriptor Country="US,GB">
      <Probability Value="10" AdProvider="InnerActive" />
      <Probability Value="10" AdProvider="Nax" />
      <Probability Value="100" AdProvider="PubCenter" />
      <Probability Value="0" AdProvider="AdMob" />
      <Probability Value="1" AdProvider="AdDuplex" />
      <Probability Value="10" AdProvider="Smaato" />
      <Probability Value="10" AdProvider="MobFox" />
      <Probability Value="10" AdProvider="MillennialMedia" />
    </AdCountryDescriptor>
    <AdCountryDescriptor Country="CN">
      <Probability Value="10" AdProvider="Nokia" />
      <Probability Value="1" AdProvider="AdDuplex" />
      <Probability Value="10" AdProvider="SmartMad" />
    </AdCountryDescriptor>
    <AdCountryDescriptor>
      <Probability Value="10" AdProvider="InnerActive" />
      <Probability Value="10" AdProvider="Nax" />
      <Probability Value="10" AdProvider="AdMob" />
      <Probability Value="1" AdProvider="AdDuplex" />
      <Probability Value="10" AdProvider="Smaato" />
      <Probability Value="10" AdProvider="MobFox" />
      <Probability Value="10" AdProvider="MillennialMedia" />
    </AdCountryDescriptor>
  </CountryDescriptors>
</AdSettings>
When clients in US & GB request the config, I'll send them only:
<AdSettings>
  <CountryDescriptors>
    <AdCountryDescriptor Country="US,GB">
      <Probability Value="10" AdProvider="InnerActive" />
      <Probability Value="10" AdProvider="Nax" />
      <Probability Value="100" AdProvider="PubCenter" />
      <Probability Value="0" AdProvider="AdMob" />
      <Probability Value="1" AdProvider="AdDuplex" />
      <Probability Value="10" AdProvider="Smaato" />
      <Probability Value="10" AdProvider="MobFox" />
      <Probability Value="10" AdProvider="MillennialMedia" />
    </AdCountryDescriptor>
  </CountryDescriptors>
</AdSettings>
And when clients in China request, only this piece will be sent:
<AdSettings>
  <CountryDescriptors>
    <AdCountryDescriptor Country="CN">
      <Probability Value="10" AdProvider="Nokia" />
      <Probability Value="1" AdProvider="AdDuplex" />
      <Probability Value="10" AdProvider="SmartMad" />
    </AdCountryDescriptor>
  </CountryDescriptors>
</AdSettings>
The smaller the xml file is, the less data quota it needs and the faster it loads.

So I can write config for as many countries as I want and don't have to worried about the file size.

Does that make sense?

Btw I'm not a native English speaker, hope I expressed myself well.