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
-
Have Your Thoughts Changed Regarding Canonical Tag Best Practice for Pagination? - Google Ignoring rel= Next/Prev Tagging
Hi there, We have a good-sized eCommerce client that is gearing up for a relaunch. At this point, the staging site follows the previous best practice for pagination (self-referencing canonical tags on each page; rel=next & prev tags referencing the last and next page within the category). Knowing that Google does not support rel=next/prev tags, does that change your thoughts for how to set up canonical tags within a paginated product category? We have some categories that have 500-600 products so creating and canonicalizing to a 'view all' page is not ideal for us. That leaves us with the following options (feel it is worth noting that we are leaving rel=next / prev tags in place): Leave canonical tags as-is, page 2 of the product category will have a canonical tag referencing ?page=2 URL Reference Page 1 of product category on all pages within the category series, page 2 of product category would have canonical tag referencing page 1 (/category/) - this is admittedly what I am leaning toward. Any and all thoughts are appreciated! If this were in relation to an existing website that is not experiencing indexing issues, I wouldn't worry about these. Given we are launching a new site, now is the time to make such a change. Thank you! Joe
Web Design | | Joe_Stoffel1 -
Need suggestion: What is the best internal linking structure for our website to gain in SEO & UX too?
Hi all, We have 3 different editions of our product we are selling with 20 features. 1st edition & 2nd edition comes with 15 features in which 10 are common in each edition. 3rd edition comes with all 20 features. Now what's the best way to interlink and show the navigational menu to highlight 3 editions and features as well? Much appreciated if some one refer me a website with such structure. Thanks
Web Design | | vtmoz0 -
Bing Indexation and handling of X-ROBOTS tag or AngularJS
Hi MozCommunity, I have been tearing my hair out trying to figure out why BING wont index a test site we're running. We're in the midst of upgrading one of our sites from archaic technology and infrastructure to a fully responsive version.
Web Design | | AU-SEO
This new site is a fully AngularJS driven site. There's currently over 2 million pages and as we're developing the new site in the backend, we would like to test out the tech with Google and Bing. We're looking at a pre-render option to be able to create static HTML snapshots of the pages that we care about the most and will be available on the sitemap.xml.gz However, with 3 completely static HTML control pages established, where we had a page with no robots metatag on the page, one with the robots NOINDEX metatag in the head section and one with a dynamic header (X-ROBOTS meta) on a third page with the NOINDEX directive as well. We expected the one without the meta tag to at least get indexed along with the homepage of the test site. In addition to those 3 control pages, we had 3 pages where we had an internal search results page with the dynamic NOINDEX header. A listing page with no such header and the homepage with no such header. With Google, the correct indexation occured with only 3 pages being indexed, being the homepage, the listing page and the control page without the metatag. However, with BING, there's nothing. No page indexed at all. Not even the flat static HTML page without any robots directive. I have a valid sitemap.xml file and a robots.txt directive open to all engines across all pages yet, nothing. I used the fetch as Bingbot tool, the SEO analyzer Tool and the Preview Page Tool within Bing Webmaster Tools, and they all show a preview of the requested pages. Including the ones with the dynamic header asking it not to index those pages. I'm stumped. I don't know what to do next to understand if BING can accurately process dynamic headers or AngularJS content. Upon checking BWT, there's definitely been crawl activity since it marked against the XML sitemap as successful and put a 4 next to the number of crawled pages. Still no result when running a site: command though. Google responded perfectly and understood exactly which pages to index and crawl. Anyone else used dynamic headers or AngularJS that might be able to chime in perhaps with running similar tests? Thanks in advance for your assistance....0 -
Infinite Scroll and SEO - Is it enough to only link to the previous and next page in the pagination?
Hi all, We are implementing an eCommerce site where the results pages of the products will be visibile on one page (always loading new products when you scroll down the page). Now, I have read that the Google spiders cannot "load" new products scrolling down the page, hence the spider only sees the first few products of the results page. Our developer wants to implement a system where a users sees the first products on example.com/products Then scrolling down, he will see new products with the URL changing to example.com/page/2 and so on. Is it enough that we add a pagination link that goes from example.com/products to example.com/page/2 Then another link that goes from example.com/page/2 to example.com/page/3 and so on, so the Google spider can make his way through all the pages? Or is that too much deep linking and the spider wouldn't even crawl all the results pages? Any recommendations how to go about this? Many thanks in advance!
Web Design | | Gabriele_Layoutweb0 -
Title Tag Suggestion
Short title tag is more useful so if we just use our targeted keyword in home page title then is it useful.? for example my website: http://www.topnotchlawsuitloans.com/ i am targeting lawsuit loans keyword so if i use <title>TNF - Lawsuit Loans | Lawsuit Funding</title> is batter to use for main page or <title>Lawsuit Loans | Lawsuit Funding | As Low As 1% | PreSettlement Funding</title> can we have to use main targeting keyword on all webpage title tag ? my website have 200+ page and i have to use different title tag for that pages including targated keyword so if i am targeting lawsuit loans in that title, what is best to divide title pipe, hyphen or comma ? does capitalization in title tag wrong effect ? Lawsuit Loans - As low as 1% Lawsuit Loans | As low as 1% Lawsuit Loans, As low as 1% (or i have to use smaller cash in title) for all different page i want to place this kind of title is it best for SEO purpose Lawsuit Loans - Lawsuit Loans Fargo Lawsuit Loans - Lawsuit Loans Escondido Lawsuit Loans - Lawsuit Loans Erie Lawsuit Loans - Lawsuit Loans Flint Lawsuit Loans - Lawsuit Loans Fort Wayne Lawsuit Loans - Lawsuit Loans Fresno Lawsuit Loans - Lawsuit Loans Gainesville Lawsuit Loans - Lawsuit Loans Grand Rapids Lawsuit Loans - Lawsuit Loans Gilbert Lawsuit Loans - Lawsuit Loans Gresham Lawsuit Loans - Lawsuit Loans High Point Lawsuit Loans - Lawsuit Loans Hialeah Lawsuit Loans - Lawsuit Loans Huntsville if i am using this kind of different title for all page then it can effective for SEO or it will be come in keyword stuffing
Web Design | | JulieWhite0 -
New Website Redesign: Any Design Comments or SEO Suggestions?
Hi! We recently launched our new website after MONTHS of work. Now that it is live, we are looking to fine tune the design and SEO efforts. This is our new website. And for reference, this is our old website. Any and all comments on design and SEO would be greatly appreciated. Thank you for your help! Mike
Web Design | | Mike.Goracke0 -
Anyone used bugherd.com for onsite seo purposes?
Just as the title says, has anyone used bugherd.com for SEO purposes? I was thinking it could be used to show client changes that need to be made regarding the website. Example could be if you are looking at a CRO prospective, you may want to change/add some graphics or text to improve conversions. It seems like a nifty tool to show the changes you want made and to keep track of them. It integrates with basecamp also 🙂
Web Design | | KyleChamp0 -
Changing H1 Tag based on referrer
Hello, I need some quick help and advice. We're going through a website re-design, and we have a few H1 tags set on some of our inner pages. The team is ok with these, however they want to change the H1 tag if the user gets to that page from a page within the site. Example:
Web Design | | uSell
When the referrer is our site (www.domain.com), the H1 tag = Go to Step 2 When the referrer is anything else, the H1 tag = Welcome to our site I'd like to keep the H1 tag as the SEO rich keyword text we agreed on (in this case "Welcome to Our Site"), however our developers don't think its directional enough and wants to change it based on the user path. I'm ok with the suggestion, however I want to make sure that if we choose the option with the referrer that this doesn't impact our SEO efforts. I'm assuming the referrer will changed based on how the bot gets to the page, but i'm not certain and was wondering if anyone had some thoughts on this.. Any help is greatly appreciated. Thanks...0