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
-
Does anyone have data on the effect of multiple H1 tags on a page?
One of my website's sub-domains is fed information from a job board master-template, thus my site (and hundreds of other sites) is just branded styling pulling from one external source. Because of the way this master template is set up (not very concerned with SEO best practices), I have found the need to hide the H1 coming from the master template, and display a new separate H1 in my styling. This is being done with user-experience in mind, but how will search engines respond to having two H1s (one hidden, one visible) on a page? I understand that a single H1 is usually ideal, and hidden page components are typically frowned upon because they don't add user value... but in this case, the hidden component is solely for the benefit of the user. I would like to find the best balance of SEO and UX, so I am very interested in any experimental data or case studies on a similar situation.
Web Design | | pbailey0 -
How to optimize SEO value of links in a calendar
Hi All- I am building a website about outdoor activities (cycling, kayaking, hiking, etc.). The site will most likely be built with either Joomla or Wordpress. A key piece of the site will be a calendar of upcoming events. The calendar will list the basic attributes of each event like date, time and location. However if an event has a webpage of it's own I will also include a link to that page in the details of the event. My question is: How can I create a calendar that will capitalize on the SEO value of the links included in the event descriptions? I've noticed many similar sites put events into a Google calendar and then embed the Google calendar into their webpage. In that situation would Google even see any external links included in the descriptions of the events? Thanks in advance for any input. -Chris
Web Design | | 1968Rouleur0 -
Java Script and Menus
I have a client who wants to create drop down menus on their E commerce Site. Currently they do not have any. If we create drop down menus I am afraid we will loose too much category and product page power. However these drop downs would be good for the user. To accomplish this drop down menu without negative SEO side effects I had an idea. Create a javascript menu. Google's spiders do not read javascript correct? This would bypass any negative effect of having an HTML menu correct?
Web Design | | waqid0 -
Ecommerce SEO - product sort order
Hi, I've been trying to find the answer to this in google but having no luck. In the current era, is it damaging to have products ordered randomly in an ecommerce website? Also, how long would you suggest is a good length of time to establish your natural rank? Ive launched and still work on several succesful ecommerce sites, but have recently launched a completely new venture - brand new url, brand new site and it has been live for around 5 weeks now, and although it is being found in search, it isnt doing as well as i'd like using the moz pro tools ive picked up some issues and have in the last few days tweaked page titles, added 'nofollow' to all my filters, added content etc, so I feel as though ive reset the clock. the site (it's an adult site by the way) is www.lovesauce.co.uk - would appreciate some feedback from the pro's
Web Design | | tom.dollar0 -
Video SEO?
What is the best way to get SEO benefits from video? Which service is best? YouTube, Vimeo or any other? Or is best just to upload direct to my own site? But then how would I handle mobile devices i.e. iPad and iPhone? How does one go about marketing a video? Thanks
Web Design | | bronxpad0 -
Missing Meta Description Tag - Wordpress Tag
I am going through my crawl diagonostics issues and I have lots of "Missing Meta Description Tags". However when I look at the url's they are Wordpress Tags, which do not have a meta description. Shall I just ignore these errors or should I find a way to add a meta description? Is it important?
Web Design | | petewinter0 -
Canonical Tag
I've been helping someone out with their website, and I noticed the person who built the site made the canonical tags like this:
Web Design | | StandUpCubicles
href="http://www.example.com/" rel="canonical" /> I'm use to seeing it how seomoz does it: Does this matter? Is it ok to have it inverted? They also have another canonical tag in there like this:
var hs_canonical_url = "http\x3A\x2F\x2Fwww.example.com\x2Fhome" Any idea what that is? Could it be hurting the site?0 -
H1 Tag, necessary or not? Hidden or not?
Our new site design utilizes H1 tags on all pages except the home page. We couldn't find a way to work it into the design. That being said, what's the opinion on necessity? Do we need an H1? If we do the image replacement thing, will that be better for SEO than none at all? Our old site had one and once we changed it to the term we wanted to optimize for we made the top 10 in less than 60 days. We don't want to lose that placement. Thoughts? You input is very much appreciated.
Web Design | | BMDM0