Unlock Your ‘Not Provided’ Keywords in Google Analytics using Google webmaster tools


If you are using google analytics to track your website traffic, then you might seen that most of the keywords provided by google analytics are either "not set" or "not provided". In this article we will see how to get the keyword data that is not provided google analytics.

Why Are Keywords ‘Not Provided’?

Due to security reasons, when a user searches while logged in google account, the keyowrds are encrypted by google and that data is showed as not provided in the google analytics.

Fortunately you can get the keyword data using the google webmaster tools.

Step 1: Login to the google webmaster tools here. You will see the screen which looks like the screenshot below.

alt text

Fill in your website url and click on Add property. You will be asked to verify. The screen will somewhat similar to the screenshot below.

alt text

Verify by using any one of the methods listed and you are good to go. After successfully verifying, you will be presented with a google search console page. In the left navigation bar, click on "Search Traffic" and then on "Search Analytics". Yor keyword data is shown in the right side.

alt text

The search analytics has four parameters namely, Clicks, Impressions, CTR, Position. you can select the parameters as per requirement and see the data. You can also select the date range to see the keywords for that particular period.

You can enable search console data sharing by following the steps listed below. These are taken from the link below.


In order to use the Search Console reports, you need to enable Search Console data sharing in your property settings. You must have administrator permissions on both the Google Analytics and Search Console accounts that are to be linked.

1) Sign in to your Analytics account.

2) Click Admin, and navigate to the property in which you want to enable Search Console data sharing.

3) In the PROPERTY column, click Property Settings.

4) Scroll down to Search Console Settings. You should see the URL of your website, which confirms that the website is verified in Search Console and that you have permission to make changes. If you do not see the URL, you need to add your site to Search Console.

5) Under Search Console, select the reporting view(s) in which you want to see Search Console data. Click Save.

Getting data by using webmasters API

You can also get the keyword data from google search console using API by installing the Google Client Library. To install the Google API Python Client on a system, use either the pip command or easy_install command.

easy_install --upgrade google-api-python-client

pip install --upgrade google-api-python-client

Here is one way of getting the data using the oauth2client.

data = {
    "_module": "oauth2client.client",
    "scopes": ["https://www.googleapis.com/auth/webmasters.readonly"],
    "token_expiry": "2017-05-17T11:45:15Z",
    "id_token": id_token,
    "user_agent": None,
    "access_token": access_token,
    "token_uri": "https://www.googleapis.com/oauth2/v4/token",
    "invalid": False,
    "token_response": {"access_token": access_token,
                       "token_type": token_type,
                       "expires_in": expires_in},
    "client_id": client_id,
    "token_info_uri": "https://www.googleapis.com/oauth2/v3/tokeninfo",
    "client_secret": client_secret,
    "revoke_uri": "https://accounts.google.com/o/oauth2/revoke",
    "_class": "OAuth2Credentials",
    "refresh_token": None,
    "id_token_jwt": None

credentials = OAuth2Credentials.from_json(json.dumps(data))

In the above code snippet, replace the values of "id_token", "token_response", "client_id" and "client_secret" with the correct values of your google account.

Once you successfully got the credentials, you can build the webmasters_service. Refer to the code below.

    # Create an httplib2.Http object and authorize it with our credentials
http = httplib2.Http()
http = credentials.authorize(http)

webmasters_service = build('webmasters', 'v3', http=http)

Now to get the list of properties in the account, add the following code.

   # # Retrieve list of properties in account

Once you have the list of sites, you can use the searchanalytics method of the webmasters_service to get the keyword data.

        "startDate": startdate,
        "endDate": enddate,
        "dimensions": ["query"]
    }, siteUrl=url).execute()

For more details about using google search console API you can visit this page https://developers.google.com/webmaster-tools/


Recent Posts






RSS / Atom