BlogHarbor Home Page
FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  UsergroupsRSS   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
random ad question
 
Post new topic   Reply to topic    BlogHarbor Community Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
tigersi



Joined: 20 Apr 2005
Posts: 174

PostPosted: Wed Oct 05, 2005 12:22 pm    Post subject: random ad question Reply with quote

Hi John,

I have an idea for advertising and am wondering if its possible to implement.

Here's what I want to do:

I'm running ads on my blog and try to make them contextual for an article's content. With Google AdSense, that's easy because Google does the heavy lifting. I'm also using other ads from Chitika and Amazon. A contraint with Google is that a user cannot run contextual ads for other affiliate programs and they must be keyword based. Thus to make my Chitika or Amazon ads be generally targeted, I do it manually on a per-article basis. The problem is the effort outweighs the return.

For Google ads, I use "includes" in either the article template or via components in the columns. For Chitika, I do something similar. For Amazon, I either do "includes" in components or manually insert the code directly into an article. I can also insert code for Chitika into an article too.

That brings me to my idea. I'd like to run variable ads using "includes" but tie the selected "include" to the category -- and I'd like to do this within the article template and even in the component if I could.

For example, for my Energy category, I must run ads for technical products while for my Culture category, it might be dvds.

Is there a way to accomplish this via coding using some sort of If statement?

Here's the segment of code I'm using right now for the top of my articles:


Code:
{{include name="includes/Chitika/chitika_ad_468x60_electronic_sw.htm"}}

<div class="articleTitle">
{{if restricted}}
<img src="/_images/locksm.gif" width="7" height="10" border="0">&nbsp;
{{/if}}
 
{{if title}}
{{title}}
{{else}}
Untitled
{{/if}}
</div>
<div class="articleAuthor">by
{{if author}}
   <a href="javascript:openWindow('{{view_user_url}}', 'info', 450, 600);">{{var name=author escape=html}}</a>
{{else}}
   Anonymous
{{/if}}
 at {{publish_time.hour}}:{{publish_time.min}}{{publish_time.ampm}} ({{publish_time.zone}}) on {{publish_time.month_name}} {{publish_time.day}}, {{publish_time.year}} &nbsp;|&nbsp; <a href="{{permalink_url}}">Permanent Link</a>
{{if cosmos_url}}
&nbsp;|&nbsp; <a href="{{cosmos_url}}">Cosmos</a>
{{/if}}
</div>

<div class="article">
<div style="float:left;width:320px;height:260px;">
{{include name="includes/Google/GoogleArticleTop300x250.htm"}}
</div>

<div class="articleBody">{{body}}
</div> 
<!-- article -->


And here's my code for a component:
Code:
{{include name="includes/Chitika/chitika_ad_160x600_books_mags_dvds.htm"}}


Thanks for any ideas!
_________________
Thanks!
Kathy (aka, Roaring Tiger)
http://bigcatchronicles.blogharbor.com
Back to top
View user's profile Send private message Visit poster's website
john
Site Admin


Joined: 16 Mar 2004
Posts: 3434

PostPosted: Wed Oct 05, 2005 11:22 pm    Post subject: Re: random ad question Reply with quote

That brings me to my idea. I'd like to run variable ads using "includes" but tie the selected "include" to the category -- and I'd like to do this within the article template and even in the component if I could.

It is possible to do what you are looking for within the context of the base template, but not within the article template.

So you can display category dependent content on your blog page, just not inside the article itself. This thread talks about how to use different content depending on the category.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tigersi



Joined: 20 Apr 2005
Posts: 174

PostPosted: Sun Oct 09, 2005 2:04 pm    Post subject: article workaround Reply with quote

Hi John,

I found a workaround to give me category-specific ads within an article. This will work for ads placed over the article title. The ad isn't exactly where I want it placed but is close enough.

I started with the instructions you gave in this thread:
http://forums.blogharbor.com/viewtopic.php?p=4033#4033

I used this to create components with category-specific Chitika ads. placed in my left column.

Additionally, though, to create a category-specific Chitika ad placed over-the-title of an article, I copied the if/then ad code into the base template, placing the code so that the ad will show at the top of the center column.

I didn't want to have these center ads showing on the main page, so I also created a table with no content that is only 2px high and inserted it into the code too. This is what is shown when a reader is on my Main Page.

So far, it's working well.

Here's the sample code I used from my base template if others are interested (you'd have to change your category and file names). I also started the copy/paste a little above where I inserted the ad code for reference. The ad code I inserted starts with

{{if category.label eq "Energy"}}

Here's the code...

Code:
{{if article.access_denied}}
<div class="message">
The entry you are requesting has restricted viewing privileges.
{{if authenticated}}
  {{if blog.allow_access_requests}}
  To request access to this entry <a href="{{article.request_access_url}}">click here</a>.
  {{/if}}
{{else}}
  Please login or <a href="{{users_signup_url}}">signup</a> for a new blogware account.
{{/if}} <!-- if authenticated -->
</div>
{{/if}} <!-- if article.access_denied -->


{{if category.label eq "Energy"}}
  {{include name="includes/Chitika/chitika_ad_468x60_electronic_sw_oil.htm"}}
{{elsif category.label eq "BP Thunder Horse"}}
  {{include name="includes/Chitika/chitika_ad_468x60_electronic_sw_oil.htm"}} 
{{elsif category.label eq "Hurricanes"}}
  {{include name="includes/Chitika/chitika_ad_468x60_electronic_sw_oil.htm"}} 
{{elsif category.label eq "Unocal Acquisition"}}
  {{include name="includes/Chitika/chitika_ad_468x60_electronic_sw_oil.htm"}} 
{{elsif category.label eq "Business"}}
  {{include name="includes/Chitika/chitika_ad_468x60_electronic_sw_biz.htm"}}
{{elsif category.label eq "Elder Parent Issues"}}
  {{include name="includes/Chitika/chitika_ad_468x60_electronic_sw_retirement.htm"}}
{{elsif category.label eq "Main Page"}}
  {{include name="includes/Chitika/chitika_ad_468x60_mainpage.htm"}}
{{else}}
  {{include name="includes/Chitika/chitika_ad_468x60_electronic_sw.htm"}}
{{/if}}

{{if message}}
<div class="message">{{message}}</div>
{{/if}}

{{include var="inner_tmpl"}}

</div>

_________________
Thanks!
Kathy (aka, Roaring Tiger)
http://bigcatchronicles.blogharbor.com
Back to top
View user's profile Send private message Visit poster's website
tigersi



Joined: 20 Apr 2005
Posts: 174

PostPosted: Sun Oct 09, 2005 2:46 pm    Post subject: Main page modification Reply with quote

Quote:
I didn't want to have these center ads showing on the main page, so I also created a table with no content that is only 2px high and inserted it into the code too. This is what is shown when a reader is on my Main Page.


Found a hole with my idea for no ads on the Main Page. What I wanted was no top ad only the front page where my articles are excerpted. Using the blank ad process I outlined above, I just noticed that no ads show even after you click on an Read More at the end of the excerpt because the article opens with the Main Page category.

Thus, I removed the Main Page blank ad and now have one showing on all Main Pages, including the one with just excerpts.[/quote]
_________________
Thanks!
Kathy (aka, Roaring Tiger)
http://bigcatchronicles.blogharbor.com
Back to top
View user's profile Send private message Visit poster's website
john
Site Admin


Joined: 16 Mar 2004
Posts: 3434

PostPosted: Mon Oct 10, 2005 6:39 pm    Post subject: Re: article workaround Reply with quote

I found a workaround to give me category-specific ads within an article. This will work for ads placed over the article title. The ad isn't exactly where I want it placed but is close enough.

Great stuff, thanks for sharing. I'm sure that other folks will find this valuable.

Although it is obvious to you now, just to be clear to people following this thread in the future it's not that "category-specific ads within an article are not possible", it would be more accurate to say that "category-specific ads within an article body" are not possible since the article template can not determine which category it is being shown in. So you can have category-specific ads on an article page by modifying the base template, but you can not have category-specific ads within the article body itself.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Search all BlogHarbor support resources.
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    BlogHarbor Community Forum Index -> General Discussion All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum