ProductCart E-Commerce Solutions Homepage
Forum Home Forum Home > ProductCart > Search Engine Optimization
  New Posts New Posts RSS Feed - Indexing Pages For E-commerce Site
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Indexing Pages For E-commerce Site

 Post Reply Post Reply Page  <12
Author
Message
EarlJ View Drop Down
Newbie
Newbie


Joined: 02-May-2007
Location: United States
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote EarlJ Quote  Post ReplyReply Direct Link To This Post Posted: 20-March-2012 at 8:53pm
Sean,
 
Can you point me to the where is the xml issue addressed?
 
On the Just In page the Canonical URL - Removal of category ID fix hasn't been updated since it was released on 10/12/10 as far as I can see.
 
These files generate an xml sitemap that includes the category number on the URL.
 
Thanks,
 
Earl
Back to Top
Guests View Drop Down
Guest
Guest
Post Options Post Options   Thanks (0) Thanks(0)   Quote Guests Quote  Post ReplyReply Direct Link To This Post Posted: 20-March-2012 at 10:08pm
Originally posted by whizzinpc whizzinpc wrote:

Only problem I see with all of this is the Canonical URL that is generated doesn't really exist. The only page that will link to the canonical URL is the sitemap. The rest of the site includes a category ID in the URL string. PC should ditch the Category ID from the URL and all will be perfect. Maybe have a default category in the Control Panel for each product...so the breadcrumbs will show up correctly because if you use a canonical URL of a product the breadcrumb that is generated is based on the first category that you added the product to.
Also, in regards to Link Juice, if someone links to a product usually they will copy paste the URL.. so if the URL has the category id then you get a link to that page instead of the canonical version and 1 product can be in multiple categories so it gets all mixed up.
 

It's complicated. 

I'm thinking it would be nice if the the category ID were not included when a category is not the context. However, when the category is the context, the current execution makes sense. 

I just finished a mod that uses the meta title tags on category and product pages to trump the otherwise generated URLs through a couple of functions and light edit on just a few PC pages ... but while doing that, saw that more thinking needs to be done on how tidy to be about URLs produced vs how much to just lean on canonical URL declarations. 

Obviously, the canonical declarations are there for this very reason -- that dynamic applications will produce various URLs for the same page. However, being tidy about how and where the application generates these URLs in proper context would be elegant if the contextual situations could be handled relatively easily enough to do this.

For example: It makes sense to include the category ID on product URLs when browsing by category (pretty important for the way the application handles context here, actually) as well as on "previous/next" navigation on product pages. It might also make sense (at least as an option) to do so on the store map, if products are included on it. 

It probably doesn't make sense (and would be better to use canonical URLs) on pages such as the home page, best sellers, featured products, new arrivals, recently reviewed & specials.

However, what about cross-selling on a product page? Could likely be that cross-sells are in the same category, but certainly can't be assumed. Use a canonical URL or include the category ID ... or, only include the category ID if the cross sell product is in the same category as the product page the user is on? Does it really matter here?

Handling the context for whether to show canonical URLs or include the category ID in the URL could be handled pretty easily by making the default link use a canonical URL and then enhancing the logic to detect whether the page calling for pcGenerateSeoLinks() is a category or product page and if so, then include the category ID. With the exception of maybe the store map generation, it would probably be better to use canonical URLs for product links everywhere else.

So, at the end of thinking this through, I agree with @whizzinpc -- to put it another way -- that it would be tidier not to use canonical URLs as just a stop-gap, but to generate them in most places by default, except for where it makes sense to include the category ID for the continuity of context in the user's browsing experience.
Back to Top
Guests View Drop Down
Guest
Guest
Post Options Post Options   Thanks (0) Thanks(0)   Quote Guests Quote  Post ReplyReply Direct Link To This Post Posted: 20-March-2012 at 10:51pm
Originally posted by EarlJ EarlJ wrote:

Sean,
 
Can you point me to the where is the xml issue addressed?
 
On the Just In page the Canonical URL - Removal of category ID fix hasn't been updated since it was released on 10/12/10 as far as I can see.
 
These files generate an xml sitemap that includes the category number on the URL.
 
Thanks,
 
Earl

Hi Earl,

I'm actually not sure when/where this was addressed. I had it in my mind that it hadn't really been, but because of a recent project and this thread, I do see that on 4.5 SP 1, it's no longer an issue.

If you'd like fix it in your code, here's what you can do:
in genGoogleSiteMapA.asp, look for something like
LOCALtmpBody=LOCALtmpBody & "|$|" &  removeChars(pcArr(2,i) & "-" & pcArr(0,i) & "p" & pcArr(1,i)) & ".htm|-|"

If your site is generating links with category IDs in them, this line will include the array location  pcArr(0,i)

Replace the line above with:
LOCALtmpBody=LOCALtmpBody & "|$|" &  removeChars(pcArr(2,i) & "-" & "p" & pcArr(1,i)) & ".htm|-|"

HOWEVER, I also discovered another issue here on the recent project I mentioned earlier: the search query creating this record set array will return duplicate product instances when products are assigned to multiple categories. Not elegant, and is probably one of the major reasons I get reports that Google doesn't accept all of the pages fed to it through the XML site map.

To address this, the db query needs to be changed as well as the code above.

Here's the query:
query="SELECT DISTINCT categories_products.idcategory,categories_products.idproduct,products.description FROM categories INNER JOIN (categories_products INNER JOIN products ON categories_products.idproduct=products.idproduct) ON (categories.idcategory=categories_products.idcategory AND categories.iBTOHide<>1" & ExcWCatsStr & " AND (NOT (categories.idcategory IN " & tmpCatList & "))) WHERE products.active = -1" & ExcNFSPrds & " ORDER BY categories_products.idcategory ASC,categories_products.idproduct ASC;"

That will always return all combinations of category ID & product ID in the look-up table, categories_products, and thus the duplicates.

As there's no need for the category ID anymore, nor to reference any associations between products and categories here anymore, this query can be replaced with the following:
query="SELECT products.description,products.idproduct FROM products WHERE products.active = -1" & ExcNFSPrds & " ORDER BY products.idproduct ASC;"

Changing the query here, though, means that the record set array changes also, so that the patch above for the canonical URLs would need to be changed to:
LOCALtmpBody=LOCALtmpBody & "|$|" &  removeChars(pcArr(0,i) & "-" & "p" & pcArr(1,i)) & ".htm|-|"
Back to Top
EarlJ View Drop Down
Newbie
Newbie


Joined: 02-May-2007
Location: United States
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote EarlJ Quote  Post ReplyReply Direct Link To This Post Posted: 23-March-2012 at 9:47pm
Wow, thanks for the detailed response and fix.
Back to Top
whizzinpc View Drop Down
Newbie
Newbie
Avatar

Joined: 17-January-2006
Location: California
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote whizzinpc Quote  Post ReplyReply Direct Link To This Post Posted: 29-March-2012 at 12:08pm
Thanks so much for that code Sean! I've been using excel to remove the duplicates all this time. Works perfectly now.
Back to Top
Guests View Drop Down
Guest
Guest
Post Options Post Options   Thanks (0) Thanks(0)   Quote Guests Quote  Post ReplyReply Direct Link To This Post Posted: 30-March-2012 at 12:36am
Glad to be helpful. 

I still think there are some unresolved issues still here vis a vis canonical URL in context, and I'm pursuing that issue. 
Back to Top
 Post Reply Post Reply Page  <12
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.