example-petstore.com

Example domain · not a real service

example-petstore.com

A stand-in for “your website” in documentation and tutorials about Google Analytics, Google Tag Manager, Search Console and structured data. There is no pet shop here, no API and no search engine.

Updated

Sent a key, token or password here? Rotate it.

Code that still points at example-petstore.com sends its requests to this server instead of the real service, including any API key, access token, password or session cookie in them. Treat those credentials as exposed:

  1. Revoke or delete the key, token or password at the real service.
  2. Issue a new one and store it where your code reads it, not in the code itself.
  3. Fix the address in your code, so the new credentials only go to the real service.
  4. Check the service’s access logs for use you do not recognise.

Where this domain appears

In every example below, the highlighted part is what to replace with your own.

Google Analytics · Tag Manager

Measuring across domains and subdomains

Guides on following one visitor across several domains use a site at example-petstore.com whose shop runs on another domain: a third-party shopping cart at example-commerce-host.com. Older tracking snippets set the domain in code:

_gaq.push(['_setDomainName', 'example-petstore.com']);
_gaq.push(['_addIgnoredRef', 'example-petstore.com']);
_gaq.push(['_trackPageview']);

These lines belong to Classic Analytics (ga.js). Classic and Universal Analytics no longer collect data. In Google Analytics 4, cross-domain measurement is set up in the admin rather than in code: Admin, Data streams, your web stream, Configure tag settings, Configure your domains. Tag Manager setups that fire a tag for .example-petstore.com need your own domains in the same way.

Structured data · SEO

The sitelinks search box

The best-known example, copied into many themes, plugins and SEO guides:

{
  "@context": "https://schema.org",
  "@type": "WebSite",
  "url": "https://www.example-petstore.com/",
  "potentialAction": {
    "@type": "SearchAction",
    "target": "https://query.example-petstore.com/search?q={search_term_string}",
    "query-input": "required name=search_term_string"
  }
}

Replace url with your home page and target with your own search results page, and keep {search_term_string} as it is. Google stopped showing the sitelinks search box in November 2024, so the markup no longer has a visible effect. A WebSite block with your own name and URL still helps with the site name in search results.

Search Console

Moving a site

Explanations of the Change of Address tool use moves such as http://fish.example-petstore.com to a new domain, or a subdomain folded into a folder. The tool only works for properties you have verified yourself, so the example addresses have to be swapped for your own.

APIs · scraping

API and web scraping tutorials

Sample code for API gateways, HTTP clients and scrapers uses a pretend shop:

BASE_URL = "https://api.example-petstore.com/v2"
products = ["https://example-petstore.com/products/grain-free-salmon"]

Requests to these addresses arrive here and get 410 Gone back, with a JSON message saying this is an example domain. The well-known Swagger Petstore sample API has its own address, petstore.swagger.io.

Landed here from your own site or code?

Questions and answers

What is example-petstore.com?

An example domain. Documentation and tutorials about Google Analytics, Google Tag Manager, Search Console and structured data use it as a stand-in for “your website”. It is not a shop, has no API and no search engine.

Is example-petstore.com a real pet store?

No. Nothing is sold here and there are no products, accounts or orders. Every address on the domain shows this explanation.

Why do requests from my site or code arrive at example-petstore.com?

Because an address from an example was copied and never replaced: in a tracking snippet, in structured data, in a Search Console setup or as the base URL of an API client. Replace it with your own domain or the real service.

I sent an API key, token or password to example-petstore.com. What now?

Treat it as exposed. Revoke it at the real service, issue a new one, store it outside your code, fix the address and check the service’s access logs for use you do not recognise.

Does the sitelinks search box markup with query.example-petstore.com still work?

No. Google stopped showing the sitelinks search box in November 2024. The markup is not an error, but it has no visible effect; a WebSite block with your own name and URL still helps with the site name in search results.

What is example-commerce-host.com?

The sister example domain: the third-party shopping cart in the same cross-domain examples, such as example-commerce-host.com/example-petstore. See example-commerce-host.com.

Sources