> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GetVerificationToken

# Package: googleSearchConsole

# Namespace: GscService

# Method link: https://dev.wix.com/docs/api-reference/business-management/seo/google-search-console/site-readiness-v1/get-verification-token.md

## Permission Scopes:
Manage SEO Settings: SCOPE.PROMOTE.MANAGE-SEO

## Introduction

Retrieves the Google verification meta tag for a site that isn't hosted
on Wix.

The tag is added to Wix sites automatically, so this method is only for a
`siteUrl`. Place the returned tag in the `<head>` of the site's home page,
then call Verify Site with the same `siteUrl`. The tag is issued for the
connected Google account, so the same tag verifies every site that account
owns. Keep it on the page after verification, because Google rechecks it.

---

## REST API

### Schema

```
 Method: getVerificationToken
 Description: Retrieves the Google verification meta tag for a site that isn't hosted on Wix.  The tag is added to Wix sites automatically, so this method is only for a `siteUrl`. Place the returned tag in the `<head>` of the site's home page, then call Verify Site with the same `siteUrl`. The tag is issued for the connected Google account, so the same tag verifies every site that account owns. Keep it on the page after verification, because Google rechecks it.
 URL: https://www.wixapis.com/gsc/connection/v1/verification-token
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  siteUrl
 Method parameters: 
   query param name: siteUrl | type: siteUrl | description: URL of the site that isn't hosted on Wix, exactly as its URL-prefix property appears in Google Search Console. For example, `https://example.com/`. Setting it for a Wix site fails with `INVALID_ARGUMENT`. Domain properties (`sc-domain:example.com`) aren't supported. Keep the tag on the page after verification: Google rechecks it, and removing it loses ownership. | required: true | validation: format WEB_URL
 Return type: GetVerificationTokenResponse
  - name: metaTag | type: string | description: The complete `google-site-verification` meta tag to place in the `<head>` of the site's home page. For example, `<meta name="google-site-verification" content="abc123" />`.  | validation: maxLength 1000
  - name: token | type: string | description: The tag's `content` value alone, for sites that set meta tags by name and value.  | validation: maxLength 500

 Possible Errors:
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: MISSING_TOKEN | Description: No Google account is connected for this site. Connect first with the GSC Connection API.
   HTTP Code: 429 | Status Code: RESOURCE_EXHAUSTED | Application Code: GOOGLE_QUOTA_EXCEEDED | Description: Google's API quota for the property is used up. Retry after the quota window resets.
   HTTP Code: 503 | Status Code: UNAVAILABLE | Application Code: GOOGLE_UNAVAILABLE | Description: Google answered with a temporary server error. Retry with backoff.


```

### Examples

### Get Verification Token
```curl
curl -X GET \
'https://www.wixapis.com/gsc/v1/verification-token?siteUrl=https%3A%2F%2Fwww.my-fashion-store.com%2F' \
-H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.gsc.siteReadiness.getVerificationToken(siteUrl)
 Description: Retrieves the Google verification meta tag for a site that isn't hosted on Wix.  The tag is added to Wix sites automatically, so this method is only for a `siteUrl`. Place the returned tag in the `<head>` of the site's home page, then call Verify Site with the same `siteUrl`. The tag is issued for the connected Google account, so the same tag verifies every site that account owns. Keep it on the page after verification, because Google rechecks it.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  siteUrl
 Method parameters: 
   param name: siteUrl | type: string | description: URL of the site that isn't hosted on Wix, exactly as its URL-prefix property appears in Google Search Console. For example, `https://example.com/`. Setting it for a Wix site fails with `INVALID_ARGUMENT`. Domain properties (`sc-domain:example.com`) aren't supported. Keep the tag on the page after verification: Google rechecks it, and removing it loses ownership. | required: true | validation: format WEB_URL
 Return type: PROMISE<GetVerificationTokenResponse>
  - name: metaTag | type: string | description: The complete `google-site-verification` meta tag to place in the `<head>` of the site's home page. For example, `<meta name="google-site-verification" content="abc123" />`.  | validation: maxLength 1000
  - name: token | type: string | description: The tag's `content` value alone, for sites that set meta tags by name and value.  | validation: maxLength 500

 Possible Errors:
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: MISSING_TOKEN | Description: No Google account is connected for this site. Connect first with the GSC Connection API.
   HTTP Code: 429 | Status Code: RESOURCE_EXHAUSTED | Application Code: GOOGLE_QUOTA_EXCEEDED | Description: Google's API quota for the property is used up. Retry after the quota window resets.
   HTTP Code: 503 | Status Code: UNAVAILABLE | Application Code: GOOGLE_UNAVAILABLE | Description: Google answered with a temporary server error. Retry with backoff.


```

### Examples

### Get the verification tag to place on a site not hosted on Wix
```javascript
import { siteReadiness } from "@wix/gsc";

async function getVerificationToken() {
  const response = await siteReadiness.getVerificationToken(
    "https://www.my-fashion-store.com/"
  );
}

/* Promise resolves to:
 * {
 *   "metaTag": "<meta name=\"google-site-verification\" content=\"Q8kT2mVhZ0pXw3sYbN7rLdE1cFaGjU4oHiKlM9nOpRs\" />",
 *   "token": "Q8kT2mVhZ0pXw3sYbN7rLdE1cFaGjU4oHiKlM9nOpRs"
 * }
 */

```

### getVerificationToken (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { siteReadiness } from '@wix/gsc';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { siteReadiness },
  // Include the auth strategy and host as relevant
});


async function getVerificationToken(siteUrl) {
  const response = await myWixClient.siteReadiness.getVerificationToken(siteUrl);
};
```

---