Vi ad integration produces 404

I’ve tried following the Framework7 instructions for integrating Vi interstitial ads. I have an app and a placement set up in Vi and I have integrated the placement id into the initialisation of my Framework7 app.

When running app.vi.createAd(); to generate the ad, I see a Javascript error in the console:

Chrome Phonegap emulator
POST https://appserver.vidint.net/api/v1/ads/sdk/interstitial 404 (Not Found)

iOS app deployed from Xcode to iPhone 8 for testing
Failed to load resource: the server responded with a status of 404 (Not Found) http://c.vi-serve.com/viadshtml/vi.min.js.map

Any ideas? Many thanks.

What do you see in console with error, do you see there kind of “NO_ADS” error message?

Hi,

Im getting the same error, here is my full output, any Idea?

Uncaught TypeError: i.vi.run is not a function
at HTMLScriptElement.scr.onload (?uuid=38ec28a002408d826d5c20980f29fd4a161c14fa:614)
scr.onload @ index.php:614
appserver.vidint.net/api/v1/ads/sdk/interstitial:1 POST https://appserver.vidint.net/api/v1/ads/sdk/interstitial 404 (Not Found)
vi.min.js:2 [vi] Event: AdError / Server response: NO_ADS

Please, any working example!

make sure you pass the right params to app.vi obj
your params shuold “fill” the “m” obj

if "a.status" === "ERROR"
means your params are not corrected

var m = {
  placement_id: j.VI_PLACEMENT_ID,
  app: {
    bundle_id: j.VI_APP_ID,
    version: j.VI_APP_VER
  },
  sdk: {
    type: "vi_android",
    version: "1.0"
  },
  device: {
    user_agent: a.navigator.userAgent.toString(),
    os: j.VI_OS || "not_recognized"
  },
  user: {},
  geo: {}
};
o.addEventListener("click", v, !1), l("POST", "https://appserver.vidint.net/api/v1/ads/sdk/interstitial", JSON.stringify(m), function(a) {
  if("OK" === a.status) {
    // long code
  } else "ERROR" === a.status ? a.error && a.error.code && h("AdError", ["Server response: " + a.error.code, 0]) : h("AdError", ["Server response status: " + a.status, 0])
}, function(a) {
  h("AdError", [a, 0])
})

http://framework7.io/kitchen-sink/
works also with vi => "disabled"
console:

var params = {
  placement_id:'pltd4o7ibb9rc653x14',
  app:{
    bundle_id:'io.framework7.testapp',version:'1.0.0'
  },
  sdk:{
    type:'vi_android',version:'1.0'
  },
  device:{
    os:'ios',os_version:'9.1',width:375,height:667,
    user_agent:'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1',
  }
};
app.request.postJSON(
  'https://appserver.vidint.net/api/v1/ads/sdk/interstitial',params,
  function(data){
    console.log(data.status);
    console.log(data.data);
    var tmpl='<{{type}} width="320" height="240" controls autoplay>\
                <source src="{{content_url}}" type="{{mime_type}}">\
              </{{type}}>';
    Dom7('.page-content').html(
      Template7.compile(tmpl)(data.data.ads[0].media_content[0])
    );
  },
  function(xhr,status){ console.log('connection error'); }
);

No, you should not do any request manually, use the vi api only http://framework7.io/docs/vi.html#vi-app-methods

Sorry for the slow response to your question above, Vladimir.

When running the Phonegap emulator on my Mac I see this error message in Chrome:

My app set up is

var sbapp = new Framework7({
    root: '#test-app',
    name: 'Test',
    id: 'com.sportengage.test',
    pushState : false,
    routes: xroutes,
    statusbar: {
        iosOverlaysWebView: false,
        iosBackgroundColor: '#c0392b',
        iosTextColor: 'white'
    },
    vi: {
        placementId: 'plt8f0wg5kxladkkyv7',
    },
});

And to call the ad I am simply running:

sbapp.vi.createAd();

I believe I have followed the instructions for creating an app and placement inside vi.ai correctly.

Any help is much appreciated.

Thanks,
Andy

When running my app on my iPhone after deploying it from XCode I see this console message via Safari:

i know we should not use it like this
it is just a quick test for the palcement/bundle id

The following NO ADS error means that no ads can be delivered to you, this can be because of few reasons:

  • there is no demand for you, it can appear a bit later
  • or, more probably, because incorrectly set up campaign, so there is no ads matching your campaign settings

I’m pushing vi guys to make a more explained blog post about how to configure it correctly, but at the moment don’t hesitate to email them at [email protected] with your issue

Thanks for this, Vladimir. We’ll play with our campaign in Vi and get in touch with their support if we don’t get anywhere.

Hey Andy!

If you can help me with your User ID or Publisher ID (check your console), I can have the team set up relevant demand for you!

Cheers,
Reeve @ Team vi

Awesome, thanks Reeve.

The account is under [email protected] - can’t find the publisher ID anywhere. If you could email me so we can take the conversation further that would be much appreciated.

Cheers
Andy

Done! I have linked LIVE demand to the only placement that existed in your account.

Do remember that when you DO create a new placement, simply select the “vi sourced demand” campaign while creating the placement. It will be a simple dropdown.

1 Like

Excellent, we’re up and running - thanks Reeve (and Vladimir).

Hi,

Allow mixed content will make the scripts load, thats kind of annoying because now everything should be serve through https, so it could be great if vi update their routing, but anyways, even if you manage to load the scripts, you might be getting this error “[vi] Event: AdError / Server response: NO_ADS” .

Did someone manage to solve it? I would apreciate any help,
Best