Would using javascript onclick functions to override href target be ok?
-
Hi all,
I am currently working on a new search facility for me ecommerce site... it has very quickly dawned on me that this new facility is far better than my standard product pages - from a user point of view - i.e lots of product attributes for customers to find what they need faster, ability to compare products etc... All in all just better. BUT NO SEO VALUE!!!
i want to use this search facility instead of my category/product pages... however as they are search pages i have "robots noindex them" and dont think its wise to change that...
I have spoken to the developers of this software and they suggested i could use some javascript in the navigation to change the onlclick function to take the user to the search equivelant of the page...
They said this way my normal pages are the ones that are still indexed by google etc, but the user has the benefit of using the improved search pages...
This sounds perfect, however it also sounds a little deceptive... and i know google has loads of rules about these kinds of things, the last thing i want is to get any kind of penalty or any negative reaction from an SEO point of view... I am only considering this as it will improve the user experience on my website...
Can any one advise if this is OK, or a "no no"...
P.s for those wondering i use an "off the shelf" cart system and it would cost me an arm and a leg to have these features built into my actual category / product pages.
-
Hello James,
Why do these pages have "no SEO value"? Is it because they are AJAX pages or because you have them noindexed? Or both?
To answer your original question, using an on-click javascript event to send a user to a page other than the URL listed in the href tag is borderline. It goes beyond the risk level I would feel comfortable with on an eCommerce site, but a lot of affiliate sites do this. For instance, all of their links out to merchant sites may go through a directory called /outlink/ so the href tag might look like .../outlink/link1234 and appear to send the user to another page on their domain, when actually the user gets redirected to the merchant's (e.g. Amazon.com, Best Buy...) website. Sometimes the user is redirected from the /outlink/... URL and sometimes they never even get that far because the javascript sends them to the merchant's URL first.
It is not cloaking unless you are specifically treating Google differently. If Google doesn't understand your site that is their problem. If you have code that essentially says "IF Google, THEN do this. ELSE do that" it is your problem because you are cloaking. Make sense? There is a very distinct line there.
The bottom line is if you want to show users a certain page then you should be showing that page to Google as well. If the problem is the content on that page doesn't appear for Google (e.g. AJAX) then you should look into optimizing that type of content to the best of your ability. For example, look into the use of hashbangs (#!) as in:
https://developers.google.com/webmasters/ajax-crawling/docs/getting-started
-
1. Google understands simple JS that is inline with your HTML. So Google understands that
is a link to domain.com. You can obfuscate this further and Google might not understand it. I've not seen Google try to parse or execute JS but that doesn't mean they can't or won't in the future.3. Google is very unlikely to spider AJAX. Many AJAX pages don't return any user readable content (most of mine return things like JSON, which is not for end user consumption) and , as such, are beyond the scope of indexation. Again, as in #2, you might want this content to be shown elsewhere if you want it indexed. https://developers.google.com/webmasters/ajax-crawling/
-
ok, i am not keen on this approach, the developers have offered an alternative... but again, i'm not sure about it, they have said they can use ajax to force their search results / navigation over my current navigation / products on my category / product pages...
this gets rid of having to use javascript to send to different url... but up above Alan mentions cloaking, which to my understanding is basically serving anything different for a search engine / person... and thats what this will do... it serves up a different navigation to people... and the products could be listed in a different order etc... search engines do not see the ajax...
Is this any better? or just as negative?
-
Are they identical, you say the search equivalent, I just wouldn't treat search engines any different
-
even thou the content is identical?
It is only the way that content can then be navigated that is different...
-
Well then, yes I would be concerned, you are serving up different content to users, that is cloaking.
-
Hi Alan,
i think i may have explained incorrectly - my search page does have the meta tag noindex,follow - it also has a canonical link back to the main search page (i.e search.html) so i do not think any of the search results will be indexed. So my concern is not duplicate content, this should not happen...
My concern is the fact i am using javascript to litterally divert customers from one page to another... its almost like the static pages are there only for the benefit of google... and thats concerning me...
-
Google can follow JavaScript links, unless you are very good at hiding them.
I would not worry too much about the duplicate content, don't expect the duplicates to rank, but your not likely to be penalized for them. you can use a canonical tag to point all search results back to the one page.
I would not no index any pages, any links pointed to a no-index page are pouring their link juice away. if you want to no index a page use the meta tag no-index,follow, this way the search engine will follow the links and flow back out to your site
read about page rank and how link juice flows
http://thatsit.com.au/seo/tutorials/a-simple-explanation-of-pagerank
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Using 410 To Remove URLs Starting With Same Word
We had a spam injection a few months ago. We successfully cleaned up the site and resubmitted to google. I recently received a notification showing a spike in 404 errors. All of the URLS have a common word at the beginning injected via the spam: sitename.com/mono
Technical SEO | | vikasnwu
sitename.com/mono.php?buy-good-essays
sitename.com/mono.php?professional-paper-writer There's about 100 total URLS with the same syntax with the word "mono" in them. Based on my research, it seems that it would be best to serve a 410. I wanted to know what the line of HTACCESS code would be to do that in bulk for any URL that has the word "mono" after the sitename.com/0 -
Google No Longer Respecting Javascript Titles & Metas
We implemented title tags and meta descriptions for one of our clients using a GTM and some JS / jQuery. It's been working well for months. Rankings started dropping and nothing had been changed. We tore our hair out. I finally noticed that Google doesn't show our titles/descripts in the SERPs anymore. So I double checked in the developer console that everything was working ok, and you can even see our title in the browser tab. Anyone else see this or have any ideas? Thanks!
Technical SEO | | bbarber570 -
Which Version Url to Use for Canonical Tags and in General for Homepage.
I want to put canonical tags on the homepage of a site. cant figure out the version of URL of the homepage should be with a / at the end or without the / ( www.example.com of www.example.com/ ) if I put into the google the URL with / I get the URL without the / in my browser, and it isn't showing as a redirect in my moz extension or other tools. But when I copy the URL from browser and paste elsewhere it pastes with a / I have two questions 1 - in general how does it work with URLs of homepages - I see this happening with lots of sites? 2 - which URL should I set as the canonical version of my homepage? Thanks so much
Technical SEO | | Ruchy0 -
Best use of an old domain?
I've discovered that my clients website used to have another domain name, which they still own but don't use. It's doing OK considering its not been used for a few years - almost 6,000 backlinks showing on Majestic. So what's the best way of using this for SEO? I'm presuming some kind of redirecting? A simple redirect of everything on the domain to the new domain index page? Or going trough all the old pages and redirecting them one by one?
Technical SEO | | abisti20 -
Genesis WP Theme H1 Tag not properly Used?
I am in the process of redesigning my website, and I have been working on the Genesis framework a lot lately, so I used the Genesis framework to make my new site. The URL is http://protechig.com As I look at the H1 on the page (homepage only, every other page has solid h1s from an SEO perspective.) The first thing that I see is that the home page H1 is a links (to protech's home page). The second thing that I see is the the title text is replaced with an image (my logo) and there is a text-indent:-99999; and overflow:hiden; I just want to know from an SEO perspective if this is okay, and, if it isn't, what I could/should to to rectify it. Thanks Zach
Technical SEO | | Zachary_Russell0 -
Are gallery sites ok post Penguin?
We're getting ready to re-launch a redesigned site and I was hoping to use the opportunity to get some quality links. Are some of the higher-quality web design gallery sites still ok to submit to? Did Penguin have any effect on these? Just looking for opportunities for a little boost from our re-launch.
Technical SEO | | _JP_0 -
When criteria do you use for external linking?
When linking out to external sources what criteria do you use? Also, do you ever add the URL in plain text instead to conserve link juice?
Technical SEO | | Charlessipe0 -
Using Thesis as blog platform vs. Tumblr
I read a lot of advantages by using Thesis as a platform for blogging, but I like the themes and other plugins from Tumblr. Are there equivalents at Tumblr to the Thesis benefits so I can go a head and go with Tumblr?
Technical SEO | | HyperOffice0