MobileHacks
New Member
Google Admanager Integration
This integration lets you target all relevant parts of your forum within google admanager:
1. Google Admanager > Inventory > Targeting
Targeting Key: usergroup
Code:
1
2
3
4
5
6
Targeting Key: script
Code:
index
showthread
forumdisplay
Targeting Key: f1 (optional)
put here all forumids from your highest forum level
Code:
1
Targeting Key: f2 (optional)
put here all forumids from your second highes forum level
Code:
22
23
Targeting Key: f3 (optional)
put here all forumids from your third highest forum level
Code:
44
Originally Posted by example forum board
2. template headinclude
Add this to the end of template and change red markings with your own information:
3. plugin global_start (optional)
This integration lets you target all relevant parts of your forum within google admanager:
- usergroup
- script
- forum (optional)
1. Google Admanager > Inventory > Targeting
Targeting Key: usergroup
Code:
1
2
3
4
5
6
Targeting Key: script
Code:
index
showthread
forumdisplay
Targeting Key: f1 (optional)
put here all forumids from your highest forum level
Code:
1
Targeting Key: f2 (optional)
put here all forumids from your second highes forum level
Code:
22
23
Targeting Key: f3 (optional)
put here all forumids from your third highest forum level
Code:
44
Originally Posted by example forum board
forumid 1 General discussion
--- forumid 22 Discussion about forums
--- forumid 23 Discussion about vbulletin
--------- forumid 44 Discussion about products
You'll want to fetch these forumids with mysql if you have lots of forums. --- forumid 22 Discussion about forums
--- forumid 23 Discussion about vbulletin
--------- forumid 44 Discussion about products
2. template headinclude
Add this to the end of template and change red markings with your own information:
PHP:
<script type="text/javascript" src="http://partner.googleadservices.com/gampad/google_service.js">
</script>
<script type="text/javascript">
GS_googleAddAdSenseService("YOUR CA-PUB");
GS_googleEnableAllServices();
</script>
<script language="JavaScript">
GA_googleAddAttr("usergroup", "$bbuserinfo[usergroupid]");
</script>
<script language="JavaScript">
GA_googleAddAttr("script", "<if condition="THIS_SCRIPT =='index'">index</if><if condition="THIS_SCRIPT =='forumdisplay'">forumdisplay</if><if condition="THIS_SCRIPT =='showthread'">showthread</if>");
</script>
<script language="JavaScript">
GA_googleAddAttr("f1", "$forumlevel[0]");
</script>
<script language="JavaScript">
GA_googleAddAttr("f2", "$forumlevel[1]");
</script>
<script language="JavaScript">
GA_googleAddAttr("f3", "$forumlevel[2]");
</script>
HERE YOU PUT YOUR ADMANAGERS ADDSLOT TAGS
<script type="text/javascript">
GA_googleFetchAds();
</script>
PHP:
$parentlist = array_reverse(explode(',', substr($foruminfo['parentlist'], 0, -3)));
foreach ($parentlist AS $forumID)
{
$forumlevel[] = $forumID;
}