Dears, i have question how to in my website put google adsence by category in meny for example:

menu for computer ads when click opet page with google adsense of computing?
Please help!

Dani AI

Generated

Short answer: AdSense decides ads from the page content and user signals — you can’t force a specific “category” tag to always show particular AdSense creatives. For the practical route is to serve different ad units on different category pages (so the page content and ad unit both match the category). That approach expands on ’s suggestion to edit your PHP/templates, but with more practical steps and a couple of safer alternatives. (See Google’s explanation of how ads are targeted.)
() ()

How to implement (simple, works on WordPress / PHP sites)

  1. Create one AdSense ad unit per site category (Beauty, Design, Jobs, etc.).
  2. Put the matching ad unit code in the category template or use conditional logic in your theme so category pages output the correct ad-slot. Example (replace placeholders with your values):
<?php
if (is_category('beauty') || in_category('beauty')) {
  // beauty ad unit
  ?>
  <ins class="adsbygoogle" style="display:block"
       data-ad-client="ca-pub-XXXXX"
       data-ad-slot="BEAUTY_SLOT"
       data-ad-format="auto"></ins>
  <?php
} elseif (is_category('design') || in_category('design')) {
  // design ad unit
  ?>
  <ins class="adsbygoogle" style="display:block"
       data-ad-client="ca-pub-XXXXX"
       data-ad-slot="DESIGN_SLOT"
       data-ad-format="auto"></ins>
  <?php
}
?>
<script>(adsbygoogle = window.adsbygoogle || []).push({});</script>

Use AdSense custom channels to tag those ad units so you can track performance by category. ()

Advanced / full control
If you must guarantee which ads run per category (for house ads or direct-sold campaigns), move to Google Ad Manager and pass a page-level key (for example category=beauty) with GPT. Then create line items targeted to that key. That method gives deterministic targeting but is more complex. (https://developers.google.com/publisher-tag/guides/key-value-targeting)

Practical tips and cautions

  • Make category pages content-rich so AdSense’s contextual system can match ads; changes can take a week or two to settle. ()
  • Don’t attempt deceptive manipulation of content or ad serving — follow AdSense program policies to avoid enforcement. ()

Checklist: create per-category ad units, add them to category templates (or use conditionals), tag with custom channels, monitor results, and upgrade to Ad Manager if you need guaranteed, programmatic targeting.

Recommended Answers

All 3 Replies

No i mean how to in my page beauty show beauty adsence ,or on my page design show adsence about design for every page difrent adsense.
example my menu : jobs ads when click show jobs ads,...

Member Avatar for Member #949455

No i mean how to in my page beauty show beauty adsence ,or on my page design show adsence about design for every page difrent adsense. example my menu : jobs ads when click show jobs ads,...

You need to add (edit) the PHP file to add adsense code manually for each page (unless you are using a platfrom):

You can also read this:

http://productforums.google.com/forum/#!topic/adsense/GNLHOKVO-L4

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.