Forum Moderators: mack

Message Too Old, No Replies

Inserting code A into blog home page but code B into all other pages

Blogger blog

         

mic089

12:21 am on Jan 10, 2008 (gmt 0)

10+ Year Member



I have a Blogger blog with my own domain name and hosting (I don't have any website building skills!). I've been asked by a potential advertiser to place tracking code A on the home page only, and tracking code B on every page except the home page.

Would it be possible to do the following:
Include some type of condition in the template such that tracking code A would be included in index.html only, and tracking code B would be included in every other page?

OR

1) include tracking code B in the blogger template
2) publish the blog to somewhere that it cannot be viewed by the public
3) modify index.html to replace tracking code B with tracking code A
4) then make the updated version of the blog available online?

Any help would be greatly appreciated!

adwatson

4:19 pm on Jan 10, 2008 (gmt 0)

10+ Year Member



It seems like you should be able to put some PHP around the tracking code snippet so that it looks at the current URL, and shows one or the other tracking code as appropriate... I'll let someone more familiar with PHP and blogger be more specific ;)

mic089

9:57 pm on Feb 17, 2008 (gmt 0)

10+ Year Member



This is what I ended up using (I added it to my Blogger template):

<MainPage>Code A</MainPage>

<ItemPage>Code B</ItemPage>

<ArchivePage>Code B</ArchivePage>