How to index in google sites that use javascript? [duplicate]

3

I'm doing a SPA site with angularJS and I'm having a hard time indexing every page on google, because as I load information via AJAX, it just indexes my home page, I've read a lot of things about it, and I have one good English, but I decided to come here to seek help from someone who spoke more clearly to me. I read something about hashbangs(#!) and _escaped_fragment_ and I even understood, but I do not know how to deal with this _escaped_fragment_ stop and create snapshots , if anyone could explain me better would be grateful.     

asked by anonymous 18.04.2015 / 15:42

2 answers

1

Actually indexing content in Ajax gives a lot of 'headache', after many months searching I found some ways, I'm still in the testing process, but, I'm already seeing good results ... you may be doing the following: p>

Google provides some tools that index content in Ajax / javascript / SEO Angular etc. I've done this process and the url's, titles and descriptions have appeared in the google search engine.

Sign in: link
Add a website, then go to rastreamento > Buscar como o Google and insert the pages you want to render and then index. There are many other excellent tools on this site for us to help, it's worth studying.

More information: link

Yannick from SEO4Ajax has made these modules available for .htaccess and social networks worked: Replace yousite with your domain name, replace put you token with your token get the token sign up on the site: seo4ajax.com) then copy and paste into your .htaccess.

<IfModule mod_headers.c>
RequestHeader set Host "api.seo4ajax.com"
</IfModule>

<ifModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
Options +FollowSymLinks
# Redirect yousite.com to www.yousite.com
RewriteCond %{HTTP_HOST} ^yousite\.com [NC]
RewriteRule ^(.*) http://www.yousite.com/$1 [L,R=301]

<IfModule mod_proxy_http.c>
# If requested with the _escaped_fragment_ query parameter, proxify
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !(index.html) [NC]
RewriteCond %{QUERY_STRING} _escaped_fragment_= [NC]
RewriteRule .* - [E=PROXIFY:true]

# If requested by a bot that does not support the specification, proxify
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !(index.html) [NC]
RewriteCond %{HTTP_USER_AGENT}  !(google.*bot|bing|msnbot|yandexbot|pinterest.*ios|mail\.ru) [NC]
RewriteCond %{HTTP_USER_AGENT}  (bot|crawler|spider|archiver|pinterest|facebookexternalhit|flipboardproxy) [NC]
RewriteRule .* - [E=PROXIFY:true]

# Proxification to SEO4Ajax
RequestHeader set Host "api.seo4ajax.com" env=PROXIFY
RewriteCond  %{ENV:PROXIFY}  true
RewriteRule ^(.*)$ <http://api.seo4ajax.com/put you token/$1> [P,QSA,L]
</ifModule>
# html5 pushstate enable
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

RewriteRule ^ index.html [L]
</ifModule>

Pass the information from your array to the schemas and meta property; Put these schemas and meta property in your views.

<div ng-repeat="item in grupo">
   <!-- Schemas -->
   <div span itemscope itemtype="http://schema.org/Article"></span>
   <span itemprop="name" content="{{item.title}}"></span>

   <span itemprop="description" content="{{item.description}}"></span>

   <span itemprop="articleSection" content="Humor"></span>

   <span itemprop="image" content="http://www.yousite.com/images/{{item.img}}" ></span>
   </div>
   <!-- End - Schemas -->

   <!-- Meta property  -->
  <meta property="og:title" content="{{item.title}}" />
  <meta property="og:image" content="http://www.yousite.com/images/{{item.img}}" />
  <meta property="og:description" content="{{item.description}}" />
  <!-- End - Meta property  -->
</div>

After SEO4Ajax captures the pages of your site, you can download the sitemap, submit it to the file manager, where you host your site, and add it to google webmaster tools, this helps also.

Any questions may be asking, if I know I'll be helping, thanks!

    
01.05.2015 / 06:59
0

Google already reads Javascript and if you go to your Google Webmaster Tool you can better understand how this works:)

    
20.04.2015 / 18:39