Notifications
Clear all

[Solved] Adding Adsense code to Ads Manager

16 Posts
4 Users
0 Reactions
3,299 Views
Posts: 7
Customer
Topic starter
(@daniel-lutton)
Member
Joined: 4 years ago

Hi, I am trying to add my adsense code to Ads Manager but will always recieve an error - Ad adding error.  

I have tried.

* Removing line breaks from code

* Tried numerous different codes that work fine on website.

* I am adding as Text

Thanks

AdManager

 

15 Replies
Astghik
Posts: 6149
Admin
(@astgh)
Illustrious Member
Joined: 7 years ago

@daniel-lutton,

Please let us know the code you're using. 

Reply
3 Replies
Customer
(@daniel-lutton)
Joined: 4 years ago

Member
Posts: 7

Hi Astghik,

code as follows

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- ForumAd -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-6855355411049399"
     data-ad-slot="8309797028"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
Reply
Astghik
Admin
(@astgh)
Joined: 7 years ago

Illustrious Member
Posts: 6149

ok @daniel-lutton, thank you.

We'll check it and back to you asap. 

Reply
Elvina
(@elvina)
Joined: 5 years ago

Support
Posts: 1403

@astghik,

We've just checked and don't find such an issue. Please make sure the "Text" mode is enabled. See the screenshot below:

add manager

If the issue still exist could you please deactivate the plugins one by one and check after each deactivation. 

Reply
Posts: 7
Customer
Topic starter
(@daniel-lutton)
Member
Joined: 4 years ago

Thanks for your reply.  Unfortunately, I am still receiving this error.  I have unwillingly deactivated most of my plugins.  I have even deactivated Ads Manager and activated again.  I have tried numerous Adsense codes. I can confirm that I am inserting as Text mode.

Reply
2 Replies
 Tom
Admin
(@tomson)
Joined: 10 years ago

Famed Member
Posts: 4213

@daniel-lutton

Please make sure you use the latest wpForo and wpForo Ads Manager addon versions only.

Also please make sure the wp_wpforo_ads table exists in database. Use Hosting Service cPanel > phpMyAdmin database manager tool. If this table doesn't exist, please execute this SQL:

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
CREATE TABLE `wp_wpforo_ads` (
`adid` bigint(20) UNSIGNED NOT NULL,
`title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`code` text COLLATE utf8mb4_unicode_ci,
`body` longtext COLLATE utf8mb4_unicode_ci,
`start_date` datetime DEFAULT '0000-00-00 00:00:00',
`end_date` datetime DEFAULT '0000-00-00 00:00:00',
`forumids` longtext COLLATE utf8mb4_unicode_ci,
`hide_for_groupids` longtext NOT NULL DEFAULT '',
`tpllocs` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`status` tinyint(1) UNSIGNED NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

ALTER TABLE `wp_wpforo_ads`
ADD PRIMARY KEY (`adid`),
ADD KEY `start_date` (`start_date`),
ADD KEY `end_date` (`end_date`),
ADD KEY `tpllocs` (`tpllocs`(191)),
ADD KEY `status` (`status`);

ALTER TABLE `wp_wpforo_ads`
MODIFY `adid` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

If your database table prefix is not wp_ please change it.

Reply
 Tom
Admin
(@tomson)
Joined: 10 years ago

Famed Member
Posts: 4213

@daniel-lutton

Once table is create, test it. if the code is not working I recommend remove all line breaks and HTML comments from your code and use it as a one line in the text editor:

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-6855355411049399" data-ad-slot="8309797028" data-ad-format="auto" data-full-width-responsive="true"></ins><script> (adsbygoogle = window.adsbygoogle || []).push({});</script>

Then delete all kind of caches (cache, cdn, minify, optimize)

Reply
Posts: 7
Customer
Topic starter
(@daniel-lutton)
Member
Joined: 4 years ago

Hi, I still require assistance with this.  This table does not exist.  My tables begin with the prefix of wpbd. I have added the table as instructed above with both prefixes.  I still get same error message.

Capture

 

Reply
1 Reply
Elvina
(@elvina)
Joined: 5 years ago

Support
Posts: 1403

@daniel-lutton,

I have added the table as instructed above with both prefixes.

Please keep the table with the wpbd_ prefix, and delete the second one with the  wp_ prefix and check again. 

Reply
Posts: 7
Customer
Topic starter
(@daniel-lutton)
Member
Joined: 4 years ago

Still no luck.  I have deleted the table as requested and still get this error.  Can I confirm that the code you have given me earlier to enter the table is correct?  I really need this resolved.

Capture

 

Reply
1 Reply
 Tom
Admin
(@tomson)
Joined: 10 years ago

Famed Member
Posts: 4213

@daniel-lutton,

The code is correct, just remove the last COMMIT; phrase and execute it. You should make sure the table exists.

Reply
Page 1 / 2
Share:
Scroll to top