How to index on google sites that use javascript?

Asked

Viewed 972 times

3

I’m doing a SPA site with Angularjs and I’m having a hard time indexing all the pages on google, because as I load the information via AJAX, it just indexes my homepage, I’ve read many things about it, and I have good English, but I decided to come here and get help from someone who spoke more clearly to me. I read something about hashbangs(#!) and _escaped_fragment_ and I even understood, but I don’t know how to deal with this _escaped_fragment_ and create snapshots, If someone could explain me better I would be grateful.

2 answers

1

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

Google provides some tools that do content indexing in Ajax/ javascript/ Angular SEO etc.. I did this process and the url’s, titles and descriptions appeared in the search engine/google searches.

Access: https://www.google.com/webmasters/tools/googlebot-fetch?hl=
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 assist, it is worth studying them.

More information: https://support.google.com/webmasters/answer/6066467?hl=pt-BR

Yannick from Seo4ajax provided these modules for . htaccess and social networks worked: Replace yousite with your domain name, replace put you token by your token (to get the token register 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 your array information to schemas and meta Property; Place 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 donwload the sitemap, send it to the file manager, where you host your site, and add it to the Google Webmasters Tools, this helps as well.

Any doubt may be asking, if I know I’ll be helping, thanks!

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.