# \[Solved\] How can I randomize when an interstitial ad is displayed?

**URL:** <https://community.thunkable.com/t/solved-how-can-i-randomize-when-an-interstitial-ad-is-displayed/1801129>\
**Category:** Questions about Thunkable X\
**Tags:** beginner, admob\
**Created:** [March 24, 2022, 10:50pm UTC](https://community.thunkable.com/t/solved-how-can-i-randomize-when-an-interstitial-ad-is-displayed/1801129 "2022-03-24T22:50:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bradofalltrades](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bradofalltrades/32/129377_2.png) [@bradofalltrades](https://community.thunkable.com/u/bradofalltrades)\
**Post date:** [March 24, 2022, 10:50pm UTC](https://community.thunkable.com/t/solved-how-can-i-randomize-when-an-interstitial-ad-is-displayed/1801129/1 "2022-03-24T22:50:49Z")

</div>

hello  
im creating a database app that leads to a single info screen and would like to put an interstitial ad there. However I don’t want it to pop up every single time they go to the screen just every 3 or so times.Does anyone know of a way to code that  
thank you in advance

---

<div class="post-metadata">

**Author:** ![Dean\_Artis](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@Dean\_Artis](https://community.thunkable.com/u/Dean_Artis)\
**Post date:** [March 24, 2022, 10:58pm UTC](https://community.thunkable.com/t/solved-how-can-i-randomize-when-an-interstitial-ad-is-displayed/1801129/2 "2022-03-24T22:58:01Z")

</div>

Pick a random number between 1 and 100. If it’s less than 34 then show the ad.

---

<div class="post-metadata">

**Author:** ![bradofalltrades](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bradofalltrades/32/129377_2.png) [@bradofalltrades](https://community.thunkable.com/u/bradofalltrades)\
**Post date:** [March 24, 2022, 11:54pm UTC](https://community.thunkable.com/t/solved-how-can-i-randomize-when-an-interstitial-ad-is-displayed/1801129/3 "2022-03-24T23:54:22Z")

</div>

this is what i ended up doing and it seems to work fine

 ![2022-03-24 (3)](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/7/87d292fdb9d35b0e8d5421ef32f897dcd03b92e6.png)

---

<div class="post-metadata">

**Author:** ![Dean\_Artis](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@Dean\_Artis](https://community.thunkable.com/u/Dean_Artis)\
**Post date:** [March 25, 2022, 12:55am UTC](https://community.thunkable.com/t/solved-how-can-i-randomize-when-an-interstitial-ad-is-displayed/1801129/4 "2022-03-25T00:55:54Z")

</div>

That’s fine too. It basically the same thing, as long as the number is less than or equal to a third.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [June 23, 2022, 12:56am UTC](https://community.thunkable.com/t/solved-how-can-i-randomize-when-an-interstitial-ad-is-displayed/1801129/5 "2022-06-23T00:56:40Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
