Adsense Ad Slot Id
Perhaps an example will help. This is from one of my sites.
First, the 'Top' insertion template, which is a 728x90 banner, which appears at the top of the content:
Note: the Google-provided ad unit JavaScript code is wrapped in a variety of HTML DIVs which allow us to style the content. I won't include the CSS files here, since that's specific to my site's theme. You can use inline if you like (as is done in the following example.)
Next, the 'Inline' insertion template, which is a 336x280 block ad, floated right.
. See that adsense ad code picture here you can see the data-ad-client or data-ad-slot which i hide with green lines. You can get your Data Client ID or Data Ad Slot in your adsense ad code which you generate in your adsense account. Make sure get that Data Ad Slot in Display Ads format only. Once you have the Publisher ID and Ad Slot ID entered (or imported) you can change ad type, ad size (fixed, fixed by viewport or responsive) and ad type for AMP pages. Once you are happy with the settings click on the generate button and the the plugin will generate ad code for the AdSense ad in the code window of the current block.
Note:You must use your publisher id (instead of google_ad_client = 'ca-pub-1234567890123456';
) and ad slot id (instead of google_ad_slot = '1234567890';
) as provided by Google AdSense, or you won't get the results you expect!
Adsense Ad Slot Idea
So, if you can't, or don't want to, use the AdSense module's [adsense:xxx] tags you must use the JavaScript ad unit code provided by Google's AdSense interface. (The AdSense module is available for Drupal 7, so you can use the [adsense:xxx] tags if you prefer, even though the AdSense module is no longer required to use Content/AdSense Injector*.)
* See #1397372: Fix module documentation and online help strings to remove references to AdSense module and [adsense] tags. and #1391562: 7.x README file incorrect: states AdSense module as requirement, which is no longer the case.)
Comments
Adsense and a block
Your publisher ID is the unique identifier for your AdSense account. To protect the security of your account and make it easier for us to find account-specific details, you may be asked to provide. You need to create ad slots in your google account and then paste the slot id into the block. I bet Google will yank the old way of doing ads at some point, once enough pubishers get on the managed ads bandwagon. Just like they ditched referrals. Log inor registerto post comments.
Here is an example of using a block to add Adsense code to your site.
- Log in or register to post comments
Update (August 26, 2013): This plugin is no longer being updated and maintained.
The latest version (2.5) of the very popular and useful AdSense Manager plugin for WordPress by Martin Fitzpatrick doesn’t allow you to use the new ad management features that were recently implemented by Google. Previously you could track the ad performance only by their channel IDs.
Adsense Ad Slot Ideas
Since the November 2007 an additional identifier is available for each of the ad units to which you can assign an explanatory title (for example, 200×200 ads, below article, etc.). These slots are also automatically given a 10 digit ID (like 6567667845) which is assigned to a new variable google_ad_slot
inside the ad code.
Theoretically, for displaying an ad you now have to know only your publisher ID and the slot ID, while the rest of the ad’s look and feel can be adjusted through your AdSense account without ever touching the JavaScript which you have placed inside the HTML.
AdSense Manager plugin generates the necessary code for an ad, while you can specify the details of an ad, like text color, border and background color. It is important to mention that using a slot ID doesn’t allow you to change the ad dimensions once you have created it. However, you can always create a new ad unit with desired dimensions through the Adsense account and use the new ID instead.
To summarize the recent changes — you are now able to alter the look & feel of the ads through your AdSense account without touching the ad code. There is also a new visual feature — rounded ad corners.
To use these features also on my blog, I have updated AdSense Manager plugin to include these updates, and release it as an unofficial 2.6 version of this amazing plugin.
AdSense Manager 2.6
I have updated the original 2.5 version of Adsense Manager with the following features:
- Ability to use ad unit slot ID instead of channel ID, and thus make better use of recent AdSense Ad Management improvements.
- Added support for the new user interface features — rounded corners: square corners, slightly rounded corners, and very rounded corners
Useful information
Read the Google Help Center information: Managing AdSense Units. Here is a suggested use for AdSense Manager and your AdSense account:
Google AdSense Account
- Create new ad units (ad slots)
- Assign channels for each ad unit (slot)
- Adjust ad style of an existing unit.
- You will not be able to adjust the dimensions (and type) of an ad that has been previously created. Simply create a new one and specify the new slot ID in your AdSense Manager.
AdSense Manager
- Configure the look&feel of the ads through AdSense Manager, but create the ads through AdSense Account (to get the Ad Slot ID).
- Use only the channel feature (no ad unit slots) for tracking your ad performance, and thus have full control over the look&feel and the size of your ads through the AdSense Manager plugin.
Found a bug, got suggestions?
Please, leave your bug reports that could be possibly related to the functionality changes described above in the comments. Your suggestions are always welcome.