Yandex.games ads

I am trying to add this ad block to my game in yandex .
I have used this on website too , it worked fine there . But , with my game I am facing issue . While uploading , those people said that please reduce the size of this ad .
I dont see any line where i can reduce it .
Could you please have a look at , as to exactly which place will reduce size of ad ?

1 Like

Hi @Ayushi_Gupta,

How are you adding the ad in your game?

1 Like

I dont know why html code is not appearing . Although i have added it is present in this post .

Are you able to share your project url, if it’s public, to take a look?

1 Like

This is

You can’t append HTML that contains <html>, <head> and <script> elements, since your app already runs on its own <html> element.

You should include the yandex SDK as an external library in your project settings:

image

You should append your <div> using the following code example, taken from the user manual (just make sure to remote all non compatible elements):

https://developer.playcanvas.com/en/user-manual/assets/html/

And now you can run your custom JS to load init the yandex SDK in your asset load event:

// when asset resource loads/changes,
// update html of element
asset.on('load', function() {
    div.innerHTML = asset.resource;

   // --- init yandex SDK
});
1 Like

After zip by playcanvas is generated , I can’t edit my html code in sublime text ?

Yes you can do that as well, just note that each time you export your project from the Playcanvas editor you will have to repeat this.

1 Like

There is a white box that appears before game starts . This is ad . However , my country is not supported , so it appears like this . But , they are saying that this ad should be smaller in size . So , the size of white box should be smaller . Which is I am not able to do .

This seems most likely an issue with the yandex SDK and how it’s loading the ad in place, not Playcanvas.

Try getting some support from them on how you should be loading the SDK and the ad in Playcanvas.

1 Like

The ads in web applications are no different from normal web sites advertisement. The advertisement is usually shown by the platform via a separate DIV element, which simply shows on top of the game canvas. Yandex is no exception - they show the ads via the <div id="yandex_rtb_xxx"> element that you added.

I don’t have any experience with Yandex advertisement, but having a quick glance at their documentation, they provide a couple of options (scroll to bottom) on how you can size your ad-block. As Leonidas mentioned, you are probably better at seeking support on their side.

2 Likes

yes and I am considering support on their side . Ads portal can be adjusted which helps in solving .