Umbraco DXP
CMSCloudHeartcoreMarketplace
  • Umbraco DXP
  • Sustainability Best Practices
  • Commercial products
    • Umbraco Forms
    • Umbraco Deploy
    • Umbraco Workflow
    • Umbraco Commerce
    • Umbraco UI Builder
    • Umbraco Engage
    • Commercial Products, Relations and dependencies
  • Marketplace
    • Introduction
    • Listing Your Package
    • Package Telemetry Data
  • Packages
    • Authorized Services
    • Storage Providers
  • Integrations
    • Categories
    • ActiveCampaign
    • ActiveCampaign with Umbraco Forms
    • Algolia
    • Aprimo
    • CookieBot
    • CommerceTools
    • Dynamics
    • emerchantpay with Umbraco Forms
    • Google Search Console
    • HubSpot
    • HubSpot with Umbraco Forms
    • inriver
    • Semrush
    • Shopify
    • Zapier
    • Zapier with Umbraco Forms
Powered by GitBook
On this page
  • Package Links
  • Minimum version requirements
  • Authentication
  • Self Hosted OAuth Configuration
  • Working With the URL Inspection Tool
  • The URL Inspection Tool API

Was this helpful?

Edit on GitHub
Export as PDF
  1. Integrations

Google Search Console

Details an integration available for Google Search Console, built and maintained by Umbraco HQ.

Previousemerchantpay with Umbraco FormsNextHubSpot

Last updated 2 months ago

Was this helpful?

This integration provides an extension for Umbraco CMS. It provides details on indexed URLs managed in Google Search Console.

Package Links

Minimum version requirements

To ensure compatibility, check the Dependencies tab on NuGet for the required Umbraco CMS version. For example, see .

Authentication

The package uses the OAuth2 security protocol for authentication. After the authorization process completes successfully, the access token and the refresh token will be saved into the Umbraco database.

All requests to the Google Search Console API will include the access token in the authorization header.

Self Hosted OAuth Configuration

The easiest way to configure the integration is to make use of an application Umbraco has pre-configured with Google. With this in place, the authorization flow will go through a proxy website Umbraco maintains before redirecting back to your Umbraco backoffice.

From version 1.1.0, we introduced an alternate approach that requires a little more setup. It removes the need for relying on any services from Umbraco when using the integration.

To use this you need to setup your own app with Google and use an extended configuration like this:

appsettings.json
"Umbraco": {
  "CMS": {
    "Integrations": {
      "SEO": {
        "GoogleSearchConsole": {
          "Settings": {
            ...
            "UseUmbracoAuthorization": true/false
          },
          "OAuthSettings": {
              "ClientId": "[your client id]",
              "ClientSecret": "[your client secret]",
              "RedirectUri": "https://[your website base URL]/umbraco/api/googlesearchconsoleauthorization/oauth",
              "TokenEndpoint": "[google token endpoint]",
              "Scopes": "https://www.googleapis.com/auth/webmasters https://www.googleapis.com/auth/webmasters.readonly"
            }
        }
      }
    }
  }
}
web.config
<appSettings>
  ...
  <add key="Umbraco.Cms.Integrations.SEO.GoogleSearchConsole.UseUmbracoAuthorization" value="true/false" />
  <add key="Umbraco.Cms.Integrations.SEO.GoogleSearchConsole.ClientId" value="[your client id]" />
	<add key="Umbraco.Cms.Integrations.SEO.GoogleSearchConsole.ClientSecret" value="[your client secret]" />
	<add key="Umbraco.Cms.Integrations.SEO.GoogleSearchConsole.RedirectUri" value="https://[your website base URL]/umbraco/api/googlesearchconsoleauthorization/oauth" />
	<add key="Umbraco.Cms.Integrations.SEO.GoogleSearchConsole.TokenEndpoint" value="[google token endpoint]" />
	<add key="Umbraco.Cms.Integrations.SEO.GoogleSearchConsole.Scopes" value="https://www.googleapis.com/auth/webmasters https://www.googleapis.com/auth/webmasters.readonly" />
</appSettings>

The authorization mode is toggled by the UseUmbracoAuthorization flag, which by default is set to true meaning that previous versions are not impacted.

The used service is provided using the AuthorizationImplementationFactory method, depending on the type of authorization selected.

The authorization controller uses the window.postMessage interface for cross-window communications when redirecting from the Google Search Console authorization server.

Working With the URL Inspection Tool

The URL Inspection Tool is accessible from each content node via the URL Inspection content app.

If you haven't connected your Google account yet, you can authorize your Umbraco application by using the Connect button. This will prompt the Google authorization window and at the end of the process, you will receive the access token and the refresh token.

You can also choose to remove access to Google Search Console API by triggering the Revoke action. This will remove the access token and the refresh token from the database.

After Google has verified your ownership, the URL Inspection tool will provide the proper results. Otherwise, a "permission denied" error will be shown.

The URL Inspection Tool API

The URL Inspection Tool API expects three parameters, two mandatory:

  • InspectionUrl - a fully-qualified URL to inspect. It must be under the property specified in "siteUrl".

  • SiteUrl - the URL of the property as defined in the Search Console.

  • LanguageCode - optional; the default value is "en-US".

Authorization specific methods are exposed by the and implemented by two services:

If you are selecting your own authorization flow that uses the AuthorizationService, the redirect URL will be this one: /umbraco/api/Googleauthorization/oauth, from . Make sure to set to correct URL in the settings of the website and in the configuration of your Google app.

Before you can retrieve data from the Search Console API you need to register the domain of your Umbraco website. This is done at the .

More information can be found .

NuGet install
Source code
Umbraco marketplace listing
Umbraco.Cms.Integrations.SEO.GoogleSearchConsole.URLInspectionTool
IGoogleAuthorizationService
UmbracoAuthorizationService
AuthorizationService
GoogleAuthorizationController
Google Search Console
in the official Google Developers documentation