Forum Moderators: martinibuster
There's my home page. (/home.asp)
There's my categories/sub-categories. (/category.asp)
There's my product (/product.asp)
These pages are NOT html, they are jumped with codes if/then etc etc.
I put my ads in my site template so they show on every page. This is the only way I know how. I made a zillion channels and found that my categories are my best pages BY FAR!
But how/where the heck to I post the adsense code on my .asp category page? I want to remove this code from my template and ONLY have it show on the category pages.
Help, please!
First remove the code from the template.
Second, on the categories page, where you want to put the ads, use the charachers %> to end the asp code. At that point, anything after the %> is regarded as normal html and you place the adsense javascript at that point.
After the adsense javascript, place the characters <% to resume the asp coding.
But one question lingers - if you are using the one bit of code in the template for all pages, the same channel will be showing on all pages won't it? Therefore setting up loads of channels is pointless if you are showing only the one channel on all pages. You would really need to generate a separate javascript code for each banner, and add it to each page individually as above for the banners facility to work. Or am I missing something?
HTH
But one question lingers - if you are using the one bit of code in the template for all pages, the same channel will be showing on all pages won't it? Therefore setting up loads of channels is pointless if you are showing only the one channel on all pages. You would really need to generate a separate javascript code for each banner, and add it to each page individually as above for the banners facility to work. Or am I missing something?
I include Adsense dynamically into my pages based on some variables like text length. I use URL channels, so my pages can still be individually monitored without any modification of the Adsense code.
@Hubie: David_uk is right, but you can also use ASP to decide whether Adsense should be included in the page or not. Use can ASP to decide whether the page is in the /categories/ directory. If it is, include Adsense, of not, do nothing.
<?php
// get the current page's location
$url = $_SERVER['PHP_SELF'];
// check if the word 'category' is present in page location
if(strpos($url, "category")!= false)
include 'adsense_code.txt';
?>
adsense_code.txt should contain the Adsense banner/link unit code.
I currently have the ads in my site template (they show up on ALL pages of my site). I created "channels" to track which pages were performing the best. To no surprise my top earning pages were:
1. My Home Page (/home.asp)
2. My category pages (/category.asp)
3. My product pages (/product.asp).
The category and product pages (and home page) consist of my template (the design frame outlining my site, including navigational links) and a billion "If" "Then" codes that I know nothing about (not my area of expertise).
Getting the ads in my template was easy as pie -- page the google script into the HTML where I wanted the ads to show.
But now I DONT WANT THE ADS TO SHOW ON ALL PAGES. I only want them on my HOME PAGE, CATEGORY PAGES, ITEM PAGES.
I took the google scripts out of my template so now no ads are displaying. I am starting at the code for my category file. It looks something like this:
<!-- include file "#*$!xx.asp" -->
etc
etc
If blah blah blah
If not blah lbahlbah
Else blah blah blah
End if blah blah blah
There is no html in this file that contains the information to display my categories.
and the question remaains: WHERE DO I PUT THE ADSENSE SCRIPT TO HAVE ADS RUNNING ON ALL /CATEGORY.ASP PAGES?
(caps not meant to yell, but meant to emphasise and clarify this situation)
Hubes