The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.
 
 
Thread Tools Display Modes
  #1  
Old 02-26-2015, 06:54 PM
John R Perry's Avatar
John R Perry is offline
Webpartner
 
Join Date: Dec 2014
Posts: 79
Default

Can someone tell me if I have AJAX installed correctly?


I've enabled PHP in HTML via htaccess

I followed the instructions here: http://kb.ecwid.com/w/page/62638683/...0Ecwid%20store
CURL PHP is installed and enabled
ecwid_ajax_indexing.php is placed in the directory.

I've placed this in the head of my store page

HTML Code:
<script>
<?php 
$ecwid_store_id = 6270010;
include_once "http://www.j-26.com/ecwid_ajax_indexing.php";
if (!isset($_GET['_escaped_fragment_'])) {
echo '<meta name="fragment" content="!" />';
}
?>
</script>
and this in the body

HTML Code:
<script>
<?php
echo '<!-- START Google AJAX indexing for Ecwid -->';
echo $ecwid_html_index;
echo '<!-- END Google AJAX indexing for Ecwid -->';
?>
</script>
I cannot tell if it's working though

http://www.j-26.com/store.html
  #2  
Old 02-27-2015, 01:50 PM
Rick G's Avatar
Rick G Rick G is offline
Ecwid Team
 
Join Date: Jun 2014
Posts: 1,271
Default

Hi John,

Thank you for contacting us.

I checked your store page: http://www.j-26.com/store.html and here's what I see:

There is a piece of PHP code here: http://take.ms/wYA1p
Let me tell you first what PHP is - PHP is a server side programming language, which means that the code itself is executed by your web server and when you actually open your website page with that code - you will see the result of the code execution and not the code itself.

That being said, if we see the PHP code in the HTML file - then it's no executed and we need to perform some changes on your website/hosting:

- First of all, make sure that your set up meets all the requirements here: http://help.ecwid.com/customer/porta...e#Requirements
- Secondly, make sure that the PHP is enabled on your web server

- and lastly, one of the main points is to either:
1. rename your website page to have a .php extension so that it will be: store.php
2. or you can enable the support of PHP codes in .html files using instructions from the web or from here: https://www.rssinclude.com/blog/36_h...l_or_htm_files

Thank you.
__________________
Ecwid API and App Market Team
Ecwid Developer Website
  #3  
Old 02-27-2015, 03:53 PM
John R Perry's Avatar
John R Perry John R Perry is offline
Webpartner
 
Join Date: Dec 2014
Posts: 79
Default

Oh awesome thank you so so much. I'll get to work on this and be back with my results very soon!
  #4  
Old 02-27-2015, 06:12 PM
John R Perry's Avatar
John R Perry John R Perry is offline
Webpartner
 
Join Date: Dec 2014
Posts: 79
Default

Wooooo I'm excited! I think we're almost there. Okay, so I tested whether or not php works with my server and it does. The page you gave me was extremely helpful in clearing up some parts that I had done incorrectly.

Here are the test result

The initial test that verifies that PHP works:



The second test that html is being parsed as php:



I removed the <script> tags that I had previously been using and now I am only using the php code

This is what's in the <head>:

PHP Code:
<?php 
$ecwid_store_id 
6270010;
include_once 
"http://www.j-26.com/ecwid_ajax_indexing.php";
if (!isset(
$_GET['_escaped_fragment_'])) {
echo 
'<meta name="fragment" content="!" />';
}
?>
This is what is in storefront widget:

HTML Code:
<div>
<script type="text/javascript" src="http://app.ecwid.com/script.js?6270010&data_platform=muse_plugin_j26" charset="utf-8"></script>
<script type="text/javascript">xProductBrowser("categoriesPerRow=4","views=grid(3,4)","categoryView=grid","searchView=list","style="); </script>
</div> 
<?php
echo '<!-- START Google AJAX indexing for Ecwid -->';
echo $ecwid_html_index;
echo '<!-- END Google AJAX indexing for Ecwid -->';
?>
The <meta name="fragment" content="!" /> is showing up now which is good and no php is showing up. Also good. However, these tags are still there:
HTML Code:
<!-- START Google AJAX indexing for Ecwid -->
<!-- END Google AJAX indexing for Ecwid -->
What should I do next

Thank you so much for the help so far!

Last edited by John R Perry; 02-27-2015 at 06:15 PM.
  #5  
Old 03-02-2015, 02:05 PM
Rick G's Avatar
Rick G Rick G is offline
Ecwid Team
 
Join Date: Jun 2014
Posts: 1,271
Default

Hi John,

Thank you for the update.

I checked your website once again and I see that the
Code:
<meta name="fragment" content="!" />
is showing up twice in the source code of the page: http://take.ms/geA8F

In order to make the indexing working correctly, this piece of code has to show up only once when you open your website normally: https://www.j-26.com/store.html and not show up in the version, that search engines see: https://www.j-26.com/store.html?_escaped_fragment_=

When I visit the former link: https://www.j-26.com/store.html?_escaped_fragment_= I see that this code is showing only once.

In our installation guide for installing a custom Google Ajax indexing we have this code:
Code:
<?php 
$ecwid_store_id = YOUR_ACTUAL_STORE_ID;
include_once "%PATH%/ecwid_ajax_indexing.php";
if (!isset($_GET['_escaped_fragment_'])) {
  echo '<meta name="fragment" content="!" />';
}
?>​
The part that I highlighted in red is a condition, which checks for _escaped_fragment_ in the URL of your browser and if it is not present, it will add the
Code:
<meta name="fragment" content="!" />
to the place where you add it.

As I see, at the moment there are two instances of code and one of them is not displayed, when I access the store page: https://www.j-26.com/store.html?_escaped_fragment_= so I presume that this code is displayed or hidden by the PHP and the other one displays at all times and it was added either manually into the <head> tags of your website or by a plugin.

Please remove the instance of this code
Code:
<meta name="fragment" content="!" />
that is not generated by a PHP code so that we can move on to the next step.

When I access your website with the escaped fragment https://www.j-26.com/store.html?_escaped_fragment_= I can see the links to your main categories in the source code of the page - that is great and that's how it's supposed to work.

Also you may notice, that when you visit your product details page like this one with escaped fragment - https://www.j-26.com/store.html?_esc...egory=11868907 you will see the description and all other information of your product in the source code: http://take.ms/CHlKe That is also great, because search engines like Google will be able to get that information about your product.

Lastly, the product details pages contain the static <title>, so the links to your products in the search results in search engines will lead to correct page, however the title of the links will be the same, which will be confusing for your customers.
In order to fix this, please follow all the steps under the advanced options in the installation instructions here: http://help.ecwid.com/customer/porta...e#Installation

Thank you.
__________________
Ecwid API and App Market Team
Ecwid Developer Website
  #6  
Old 03-19-2015, 06:52 PM
John R Perry's Avatar
John R Perry John R Perry is offline
Webpartner
 
Join Date: Dec 2014
Posts: 79
Default

It's working! Thank you so much for the help!

I've got 2 new questions.

1. What if I wanted to grab the image, title, and description and pass it over to open graph and twitter card? Is that possible?

2. Adobe Muse produces a mobile and a desktop version of the same site. Canonical tags are automatically placed on every mobile page so that there isn't duplicate content. Would it be possible to alter the canonical tags produced by script? Because if I can't, I either have to not index the mobile store (which isn't good for the upcoming mobile favoritism that Google is doing in April) or I have to have duplicate content which isn't good for obvious reasons.

Do you have any advice?
  #7  
Old 03-25-2015, 01:37 PM
Rick G's Avatar
Rick G Rick G is offline
Ecwid Team
 
Join Date: Jun 2014
Posts: 1,271
Default

Quote:
Originally Posted by John R Perry View Post
It's working! Thank you so much for the help!

I've got 2 new questions.

1. What if I wanted to grab the image, title, and description and pass it over to open graph and twitter card? Is that possible?

2. Adobe Muse produces a mobile and a desktop version of the same site. Canonical tags are automatically placed on every mobile page so that there isn't duplicate content. Would it be possible to alter the canonical tags produced by script? Because if I can't, I either have to not index the mobile store (which isn't good for the upcoming mobile favoritism that Google is doing in April) or I have to have duplicate content which isn't good for obvious reasons.

Do you have any advice?
Hi John,

Thank you for the update, I'm glad that the indexing of your store is working as you wanted.

I see that you wish to transfer the product data like product title, image, description to another service.

The thing is that the PHP script for Google Ajax indexing gets its information from your Ecwid store using Ecwid APIs, so if you wish to transfer the data about your product to another service, you can alter this PHP script to pass all the required information where you need using Ecwid Product API.

It is not necessary to alter the existing Ecwid Ajax indexing script, you can create a separate solution, which will get all the info you need and pass it to the services that you require using Ecwid API.

The second question is a bit similar to the first one in terms of an answer - the canonical link is formed by a php variable: $ecwid_canonical So if you want to alter the link that is formed, please alter this variable accordingly in the PHP script.

Please mind that you will need to save the previous coding if you decide to update the script someday in the future and this task requires advanced knowledge in PHP so if you are not sure how to alter the PHP script, please contact a professional developer.
Thank you.
__________________
Ecwid API and App Market Team
Ecwid Developer Website
 
The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.

Tags
ajax, htaccess, indexing, php, seo

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:45 PM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.