How to check domain is verified using Google Analytics API?

163 views Asked by At

I have used analytics.read in order to get user's sites and Google API response is:

{
    "kind": "analytics#accountSummaries",
    "username": "[email protected]",
    "totalResults": 1,
    "startIndex": 1,
    "itemsPerPage": 1000,
    "items": [
        {
            "id": "92159597",
            "kind": "analytics#accountSummary",
            "name": "MyNewDomain",
            "webProperties": [
                {
                    "kind": "analytics#webPropertySummary",
                    "id": "UA-92159597-1",
                    "name": "MyNewDomain",
                    "internalWebPropertyId": "236529827",
                    "level": "STANDARD",
                    "websiteUrl": "http://www.example.com",
                    "profiles": [
                        {
                            "kind": "analytics#profileSummary",
                            "id": "140745434",
                            "name": "All Web Site Data",
                            "type": "WEB"
                        }
                    ]
                }
            ]
        }
    ]
}

Why there is no property related to domain status? How should I check whether domain is verified or not?

I tried to use siteverification scope for Google Verification API, it has the response that I need and it returns the list of verified domains but it has a scope of managing domains, so no one will actually grant access to our application in order to manage their domains and verify/un-verify domains.

Sample response:

{
  "id": "string",
  "site": {
    "type": "string",
    "identifier": "string"
  },
  "owners": [
    "string"
  ]
}

How can I use analytics.read to get verified domains not unverified websites?

0

There are 0 answers