Advertisements in Text Widgets

I am having problems installing several advertisements in text widgets with typical code as follows:

<!-- FOW_MPU_1 -->
<div id="div-gpt-ad-1343760633538-0" style="width: 300px; height: 250px;"><script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1343760633538-0'); });
</script></div>

The text box is there but the ads are not displaying.

How can I resolve this issue?

Thanks

Hello there,

I hope you are doing well today.

Please remove “<!-- FOW_MPU_1 -->” from the ad code and check to see if the ad appears.

Best Regards,
Support

Hi @supertrooper,

Thank you for your question.

It seems you are trying to use Google ads which you can use as described in the following page.

Best Regards,
Movin

Hi Movin

I deleted “<!– FOW_MPU_1 –>” from the ad code but without any success.

The ads are not Google Ads but from an advertising company. They already work perfectly in a text widget on another WordPress site.

There must be a way to resolve this issue.

Please advise.

I have tested it on my test site by adding shared code in the text and custom HTML widget but it is displaying the following error.

Uncaught ReferenceError: googletag is not defined

There must be some more code than the above shared so could you please contact the advertising company?

Also to confirm this is not theme related issue, you can test it by temporary activating any default WordPress theme like twenty seventeen.

In the meantime I was able to resolve this issue.

The page I was using to test was blocked by an ad-blocker.

Thanks for your great support.

You are most welcome here :slight_smile: