Adding Google Ads to lists between articles

Learn how to add your Google Ads units into lists between articles

In this guide, we will guide you through the process of displaying your Google Ads within your MobiLoud News app.

The idea here is to display a Google Ad after every 5 articles, but you can easily configure the number of articles if you’d like.

1 - Go to the “Advertising” settings

On the MobiLoud plugin configuration area, go to the “Advertising” settings

Notion image

2 - Scroll to “Show ads between the articles in the lists”

Notion image

3 - Make sure “Enable ads in the lists” is checked

Notion image

4 - Add the “Static HTML content” code

In this area, you will want to add the Google Publisher Tags Javascript file, also known as gpt.js, and it should look like this:

<script async src=""></script>
Notion image

5 - Add the “Ad HTML” code

Now you will add the code responsible for generating the ads that will be displayed after every 5 articles.

Make sure to replace the ad unit code and IDs with your own, otherwise, this will not work:

	googletag.cmd.push(function() { 
		adNumber = "###ML_COUNTER###";
		adSlots[adNumber] = googletag.defineSlot("/XXXXXXXX/AD_UNIT", [[320, 50], [300, 250]], "div-gpt-ad-XXXXXXXX-###ML_COUNTER###").addService(googletag.pubads()); 

<div id="div-gpt-ad-XXXXXXXX-###ML_COUNTER###"></div> 
	setTimeout(function () { 
	}, 200); 
Notion image

6 - Select the interval

You can now determine after how many articles the ads will be displayed:

Notion image
Did this answer your question?