User Tools

Site Tools


Sidebar

magento_2:google_indexing_api

See the way the Google Indexing API for Magento 2 extension works.

Guide for Google Indexing API for Magento 2

The Google Indexing API extension allows you to send indexing requests directly to Google from the Magento admin panel. This significantly accelerates the process of indexing recent changes to website pages, thereby enhancing the visibility and rankings of your Magento 2 store.

  • Establish a connection with the Indexing API provided by Google
  • Submit URLs for indexing manually or enable auto-indexing
  • Request URL deletions from indexing with just a few clicks
  • Monitor the indexing status of each URL on a handy grid
  • Initiate indexing right from any edit page (product, category, CMS)
  • Compatible with Hyva Theme and Hyva Checkout by default
Please note that indexing requests are based on the URL rewrites generated by Magento.

General Configuration

General

To start configuring the module, go to Stores → Configuration → Amasty Extensions → Extensions → Search Engine Indexing → General.

Enable - set to Yes to activate the extension.

Indexing Lag (in minutes) - specify the number of minutes after which scheduled indexing requests will be dispatched to Google. The default is set to 15 minutes, but you can change it if needed.

We advise using a lag for indexing requests, giving you time to make additional modifications before the request is dispatched to Google.

Google Access Credentials

Please note that to send indexing requests via the Indexing API using the extension, it is necessary to complete the Google prerequisites and activate access to the API first. This involves registering the application, enabling the API, creating a project and a service account, generating credentials (private keys) in the Google Cloud account, and verifying your site ownership in the Google Search Console.
To simplify this process for you, we’ve prepared step-by-step instructions on how to set up the Indexing API provided by Google. Please find these instructions in a separate section of this guide → Google Indexing API: step-by-step setup instructions.

Private Key JSON File - upload the JSON key file you generated and downloaded from the Google Cloud Console. Once the file is uploaded, click the Save button.

Check the connection status details in the table that appears after the file is uploaded:

Auto-indexing

The extension allows you to send indexing requests both manually and automatically. In this tab, you can configure automatic indexing.

Enable - set to Yes to allow automatic submission of indexing requests.

Auto-Indexing for Pages - select which pages the extension will automatically request indexing for when they are added, updated, or deleted.

  • Product Pages - all existing product pages on the instance.
  • Category Pages - all existing category pages on the instance.
  • CMS Pages - all existing CMS pages on the instance.

Index Product Pages When Attributes Change - choose the attributes whose changes will trigger the submission of product page URLs for indexing.

Indexing Schedule Log

Here, you can enable the cleaning of the Indexing Schedule Log and specify the number of days after which the records will be automatically removed.

Manage Indexing Requests Manually

Bulk Request Form

This extension enables the manual submission of single or multiple URLs for indexing, as well as the deletion of these URLs from indexing. Navigate to Amasty → Extensions → Search Engine Indexing → Indexing Request to perform these actions.

1. Choose the appropriate operation from the Action dropdown first:

  • Submit URLs for indexing - to schedule the request(s) for URL(s) indexing;
  • Delete URLs from indexing - to schedule the request(s) for URL(s) deletion from indexing.

2. Paste the URL or URLs for which you’d like to perform the selected action for. Please input each URL in a new line if submitting multiple URLs.

3. Click the Submit button. After submission, you can track the current request statuses on the Indexing Schedule Log grid.

‘Submit for Indexing’ Button on Edit Pages

Also, you can request indexing for any particular Magento page of product, category, or CMS type by clicking the Submit for indexing button located at the top panel on its edit page.

  • Product Edit Page

Go to CatalogProducts → select the desired product from the grid→ click the Edit option in the Action column:

  • Category Edit Page

Go to CatalogCategories → find and open the needed category:

  • CMS Edit Page

Navigate to ContentPages → find the desired page on the grid→ click the Edit option in the Action column:

The Indexing API has a default daily limit of 200 requests provided for free. You can request increasing of this quota in the Google Cloud Console (it may require creating a billing account). The Google Indexing API extension itself operates within the quota configured for your Google Cloud project.

Indexing Schedule Log (grid)

All indexing requests, whether single or multiple, sent automatically or manually, are stored in the Indexing Schedule Log. To access the grid with these records, navigate to Amasty → Extensions → Search Engine Indexing → Indexing Schedule Log.

You can view and filter the following information on the grid:

  • ID - unique identifier for each record;
  • URL - page URL scheduled for indexing;
  • Trigger - the reason for the indexing request (url_updated or url_deleted);
  • Status - current status of the indexing request (pending, success, canceled, or error);
  • Added At - date and time when the request recording was created;
  • Scheduled At - date and time scheduled for request dispatch to the search system (Google), depending on indexing lag set in general settings;
  • Transmitted At - date and time when the request was sent to the search system (Google);
  • Message - explanation of the issue if the status is ‘error’.

If you are sure and are not going to make additional modifications to the page, you have the option to transmit its URL for indexing directly from the grid (without waiting for the indexing delay to expire) by clicking the Transmit Now button in the Action column.

Moreover, you can utilize two mass actions after ticking the needed products you want to apply them for:

  • Delete - to remove recordings from the grid in bulk;
  • Transmit - to instantly transmit URLs for indexing in bulk.

Google Indexing API: step-by-step setup instructions

To activate access to the Indexing API, we recommend taking the following steps:

1. Log into the Google Cloud (API) Console

2. Create a new project or use an existing one:

3. After the project is created, you will be asked to confirm it and enable the API:

4. Then, create a service account:

5. Generate private API keys:

6. Upload the downloaded file to the Private Key JSON File setting located in the Google Access Credentials tab of the extension.

7. Open Google Search Console to verify your site ownership

8. Click Add property, select its type, and specify the URL:

9. Download the provided HTML file, upload it to your Magento root folder and click the Verify button:

10. If the ownership is confirmed, you’ll be able to access the property settings by clicking the Go to Property button

11. Navigate to Settings → Users and Permissions and click the Add User button. Then, copy the value of the 'client_email' field from the JSON key file you downloaded from Google Cloud and paste it to the Email Address field. Select the Owner role from the Permission dropdown. Finally, click the Add button:

12. Run the google/apiclient command in the composer terminal.

That's it! Now you can not only send indexing requests using the extension but also check if they are indexed in Google Search Console (URL Inspection Tool).


Find out how to install Google Indexing API for Magento 2 via Composer.

Rate the user guide
 stars  from 0 votes (Details)
magento_2/google_indexing_api.txt · Last modified: 2024/07/22 07:17 by kkondrateva