Script tags and seo
-
Hi,
I have a page on my site with a google map embed, and a path drawn on the map. The path is made from a long string of coordinates. For ease I have the co-ordinates placed in a script tag at the foot of the page, amongst my javascript
My question is, will this script tag hurt the seo for the page? I've read that inline js and 'data islands' can be bad, so I've been careful to keep it out of the main body of the page. Thanks, any help appreciated!
-
Inline scripts aren't bad per se, search engines just can't always understand them. Worst case scenario: you have extra code that Google has to crawl but doesn't understand, which takes up bandwidth and doesn't add value. But, it won't lower your rankings.
So, do whatever you need to do to deliver the best user experience you can on your site with this map and related route, and figure that Google will ignore it (Google is trying to understand it, though, so it may be helpful in the long run). Then, for search engines, include some text content describing the map and the route so that search engines can send the right searchers to your page.
Good luck!
Kristina
-
Okay great, that's very helpful.
What if I wanted to have multiple scripts, say, for points of interest along the route, and had multiple (20+) tags at the bottom of the page? Would this be an ugly way of doing it, or considered totally okay in the eyes of google?
-
Yes, that's an inline script (putting it at the top or bottom will still be inline), but as I said, if only one page is using that script, you are good to go. There's nothing bad in using inline scripts if they aren't going to be used on other pages as well.
-
Thanks Federico.
As my script is being called at the bottom of the page, I would assume it doesn't count as 'inline'?
Yes the scripts are only being used once on specific pages.
-
Inline scripts are bad if you are bringing them on every page, if that's the case, just use scrip embedding so users don't need to download the scripts EVERY time they see a page.
But, if the inline script is used only on a specific page and not reused, then there's no reason to load it as an external file. In my opinion, that will even need an extra server call to bring a code that only works on that page.
Hope that helps!
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
-
Magento Category H1 Tags
I am currently using magento and have all titles labeled correctly. I have made a H1 tag for the main page which works fine. Each product title becomes and H1 tag, which again is fine. However my category pages are missing H1 tags. If I manually code an H1 tag, then there becomes 2 H1 tags. It is using my category name then my manual H1 tag. I don't want it to use my category name because it is shortened to fit on my navigation bar.
Web Design | | nchachula
Ex. www.mydomain.com/tshirts/short-sleeve
In this example the subcategory title is short sleeve. When using MOZ tool on frontend it shows NO H1 tag or the title becomes H1 tag "short sleeve" however I want the H1 to actually be "short sleeve tshirts"
If I manually add an H1 tag to description on category page it adds both the title AND the H1 tag I enter.0 -
Will SASS ruin my SEO?
Hello, I am thinking about using SASS for my website, striping the current CSS style sheets and translating it all to SASS.. will this hurt my SEO?
Web Design | | DanielBernhardt0 -
Other tags inside an H1 tag
So I have a situation with the website I'm currently redesigning where the H1 titles are supposed to mix colors per the current brand strategy. The branding crew is adamant that this has to be done so there is no use in saying "just don't do it". To accomplish this I'm wrapping the words that need to be the other color in a . Additionally, some pages have a "sub text" as part of the title, floated to the right and in a smaller font but with the same multi color treatment. I'm wondering if the sub text should be in an H2 and positioned to the right or if it would be beneficial to have the text in the H1 as well. An example of what I'm talking about would be something like this: "Big Shoes for Big Guys - Nike Shoes" In that, the "Big Shoes" and "Nike" would be one color and the "for Big Guys" and "Shoes" would be another. I can imagine having the "Nike Shoes" as part of the H1 would be a good idea in some respect but I'm not certain of that. In order to make that happen I can only think of one way to do it: -H1-
Web Design | | EscaladeSports
Big Shoes
-span- for Big Guys -/span-
-div- Nike
-span- Shoes -/span-
-/div-
-/H1- So that brings me back to the original concern, do search engines care about tags inside the H1? The only other way to accomplish the color changes that I can think of would be to have a fairly large chunk of javascript setup to go through H1's to colorize them using the span tags. That is unless GoogleBot has started to execute javascript while crawling the sites now...1 -
Does Using Magento With Multi Sites Affect SEO
We have a client who has 3 separate websites targeting the US, Australia, and the UK. Each of them has relevant ccTLD's such as: .com .com.au and .co.uk. Our client wants to use the Magento multi-site function so it combines all the stores (which are the exact same products) and merge it into one through Magento. These sites are all hosted in the US and had nothing to do with me haha! I understand Rand has mentioned on a video it would be best having the websites with ccTLD's hosted in that country (if budget permits), however in this case the budget doesn't permit us to go down that road. Has anyone any advice on this matter, has anyone did this before and had a lot of success with the SEO? At present there doesn't seem to be a lot of information about it and opinions are varied and sometimes divided. Any help would be very much appreciated guys Thanks, Matt
Web Design | | HigherthanSEO0 -
How do I reduce my vast number of errors that SEO Moz has picked up?
Hi, The number of errors on my site recently jumped up by 450. Most of them are duplicate page content and title errors. I am confused as to how the site suddenly got so many errors. I recently added a new sitemap extension to the site as I was told by my developers that it was hacked a couple of months ago. Please could someone help resolve these errors?
Web Design | | Saunders18650 -
Site Activity, SEO, and behind login
I have a site that provides online education and as such, most of the user activity happens behind a login. This has me thinking about potential SEO impacts with a few questions that maybe someone could lend some light on: How important is activity (above just search activity) to the search engines Would it help to enter these pages, even though they're behind a login, into GA as we have with the front-end of the site Does a subdomain make a difference (right now we implement the course as a subdomain of the main site Lastly, as I was looking at compete.com, I am wondering how they get these use statistics?
Web Design | | uwaim20120 -
Websites with only one "html file" and page href # is good for SEO?
I bought one website from templatemonster that contains only one HTML and the pages are generated by links (PROGRAMACAO) My website: www.nextformaturas.com.br This is good in term of SEO? or it is better an website with deveral pages with diferent contents? What are the pros and cons? I really lost on this.
Web Design | | Naghirniac0 -
Website using javascript to serve up content - SEO Friendly?
I'm checking out a dentist website http://www.sagedentalnj.com/ I was referred by a friend so just taking a little peek at it. When you click on the menu items, the url at the top doesn't change. When you view source, the page titles are all the same. when I do site:http://www.sagedentalnj.com/ none of his pages are indexed by google. What can be done with his site so that google sees his pages? Maybe submit sitemap?
Web Design | | Czubmeister0