2010-08-01
Main Menu
external Links
Most Read
Support

If you like the products on these pages, your support is highly appreciated. Thank you very much!

Amount: 

WordPress Google Ad Manager Plugin Installation and Usage
Written by Andreas Berger   
Saturday, 17 January 2009 18:37

A step for step tutorial on how to install and use the bretteleben.de Google Ad Manager Plugin for WordPress.

Installation

1.)

Unzip the archive and copy the folder 'wp-google-ad-manager-plugin' into the directory '/wp-content/plugins/'.

2.)

Activate the plugin in your WordPress backend.


 

Setup

The configuration of the plugin is situated at "Settings" > "Google Ad Manager"

1.)

The parameter "Pub Id" takes your Google Ad Manager Publisher Id.

You may find it e.g. in your Adsense Account at "My Account" > "Account Settings" near the bottom of the screen (AdSense for Content: ###########)

2.)

The fields S0 to S6 take 1 Ad-Slotname each.
These are called later - referenced by the field-name from your template, post or article.

3.)

The fields S7 to S9 take as many Ad-Slotnames you want, separated by a comma ",".

When the plugin calls one of these Arrays - referenced by there names 'S7', 'S8' or 'S9' - it will use each of the given Slots one time per page.
Use these fields when calling ads from within a post or from a position in your template, that is called more then one time per page. Set 3 slots and the first three posts will display the ads. Set 5, 7, 10 ... exactly.




Usage - Basics

The fields S0 bis S9 are called from Template, Post or Widget with: <!-- begam{field_name} -->.

1.) from template:

To call ads from within your template (above or below content, at a fixed position in your sidebar, and so on ...) insert the call directly into the sourcecode of the template.
The call comes as HTML-comment and looks such as:
<!-- begam{field_to_use} -->
where "field_to_use" is one of the fields above: S0 - S9, so - to call field S1, the call would look such as: <!-- begam{S1} -->

2.) from posts:

To call ads from within a post, switch to HTML-view and insert the call at the position, you want the ad to be displayed within your post.
The call comes as HTML-comment and looks such as:
<!-- begam{field_to_use} -->
where "field_to_use" is one of the fields above: S0 - S9, so - to call field S7, the call would look such as: <!-- begam{S7} -->
You may want to use the fields 7 to 9 with your posts, because they allow to set more than one slot. How many slots you set in these fields is up to you. Set 3 slots and the first three posts will display the ads. Set 5, 7, 10 ... exactly. :)

3.) from a widget:

To place ads in your sidebar, ad a Text-widget (for "Arbitrary text or HTML" - it comes with WordPress) to your sidebar and put into it the call, which again looks such as:
<!-- begam{field_to_use} -->
where "field_to_use" is one of the fields above: S0 - S9, so - to call field S3, the call would look such as: <!-- begam{S3} -->


 

Usage - Parameters

The plugin supports additional attributes. These are - optional - added to the call in two additional sections, separated by forward slashes "/".
The complete Call may consist of up to three sections:
<!-- begam{field_to_use/targeting_attributs/page_attributs,slot_attributs} -->

1) Custom Targeting - GA_googleAddAttr(key, value)

The optional second section may contain custom Ad Manager target-attributes that influence ad selection.
For further information on these parameters please refer to the Google Ad Manager Help.

A custom target-attribute always consists of two parts, the attribute and the value.
They are declared following the scheme: Attribute "comma" Value. E.g.:

Gender,male

To use more than one attribute, separate them with a semicolon ";" E.g.:

Gender,male;AgeRange,18To24

The complete call for field S3, using custom target-attributes may look such as:

<!-- begam{S3/Gender,male;AgeRange,18To24} -->

2.) Page-level and slot-level attributes - GA_googleAddAdSensePageAttr(param, value), GA_googleAddAdSenseSlotAttr(slotname, param, value)

The optional third section may contain Ad Manager page-level attributes and/or Ad Manager slot-level attributes.
For further information on these parameters please refer to the Google Ad Manager Help.

2.1) PageAttributes - GA_googleAddAdSensePageAttr(param, value)

A PageAttribute always consists of two parts, the parameter and the value.
They are declared following the scheme: Parameter "comma" Value. E.g.:

google_color_bg,FF0000

To use more than one attribute, separate them with a semicolon ";" E.g.:

google_color_bg,FF0000;google_color_link,00FF00

The complete call for field S3 using custom target-attributes and PageAttributes may look such as:


<!-- begam{S3/Gender,male/google_color_bg,FF0000;google_color_link,00FF00} -->


2.2) SlotAttributes - GA_googleAddAdSenseSlotAttr(slotname, param, value)

A custom slot-level attribute always consists of three parts, the slot, the parameter and the value.
They are declared following the scheme: Slot (represented by "S") "comma" Parameter "comma" Value. E.g.:

S,google_color_bg,FF0000

To use more than one attribute, separate them with a semicolon ";" E.g.:

S,google_color_bg,FF0000;S,google_color_link,00FF00

(Notice: The "S" is replaced by the plugin with the corresponding Slotname automatically.)

The complete call for field S3, using custom target-attributes, page-level attributes and slot-level-attributes may look such as:

<!-- begam{S3/Gender,male/google_color_bg,FF0000;S,google_color_link,00FF00} -->

PageAttributes and SlotAttributes are declared in the same - third - section. The order is of no relevance, the plugin separates them by the number of there parts (2 for PageAttributes, 3 for SlotAttributes).

3.) IMPORTANT!!!

To use page-level or slot-level attributes without using target-attributes you have to declare an empty second section, otherwise the plugin will not be able to execute the call correctly.

In this case, the first section (field_to_use) is followed by 2 forward slashes!

The complete call for field S3, using page-level and slot-level attributes but no custom target-attributes may look such as:

<!-- begam{S3//google_color_link,00FF00;S,google_color_bg,FF0000;S,google_color_link,0000FF} -->

Last Updated on Saturday, 26 September 2009 12:04
 
Comments (2)
@TopherX
2 Wednesday, 27 May 2009 21:28
A. Berger
Hi TopherX!

The plugin is only able to write the script tag that contains the fillslot-command. The URL you see is available only after the scripts in the head of the page enabled GoogleAdManager and the slot finally gets filled. I know, this doesn't help a lot, but if you have a look at the Google AdManager Help-Forum, the error you see happened before. Please get me right, I'm not trying to point away from me/my extension, but I am afraid, I will not be able to help in this case.
To verify, that the problem is not caused by the extension, you might try to change the creative displayed from Adsense/GAM-hosted to a third party creative or an image-/flash-redirect. I´m pretty sure the problem is bound to certain kinds of creatives.

If I´m wrong and the problem persists with different kind of creatives, please report back and I will go on trying to reproduce it (something I failed this time).

Best regards
Andreas
Extra Google code written to the page
1 Wednesday, 27 May 2009 05:54
TopherX
http://googleads.g.doubleclick.net/pagead/iclk?sa=l&ai=BPQ2ywsYcSrLdJYW4Vb
DukYAFqYjokQEAAAAQASDjp9sDOABY5dHr0gpg_YiMgegDsgEbd3d3LnJldGlyZWRwb3JucHJ
vZHVjZXIuY29tugEKMzAweDI1MF9hc8gBCdoBI2h0dHA6Ly93d3cucmV0aXJlZHBvcm5wcm9k
dWNlci5jb20vqQJo1D1NSReuPsACAuACAeoCG1JQUF9Ub3BSaWdodFNpZGViYXJfMzAweDI1MP
gC9NEekAPgA5gD4AOoAwE&num=0&client=ca-pub-xxxxxxxxxxxxxxxx&adurl=

This gets written to the page under the ad when the sidebar widget is used.
English
Panoramic Image Viewer
AddThis Social Bookmark Button
Who's Online
We have 24 guests online
Latest Items