alooi14 / analytics-issues

Automatically exported from code.google.com/p/analytics-issues
0 stars 1 forks source link

View created via API gives an Illegal State error when "View Settings" is selected via the website #672

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Name of affected component: Analytics Management API

Name of related library and version: google-api-python-client (1.4.0)

Issue summary:

I have created a view via the api using the following code snippet:

  try:
    view = service.management().profiles().insert(
             accountId=profile_id,
             webPropertyId=property_id,
             body={
                   'name': name,
                   'type': 'WEB'
             }
           ).execute()

The view is created and the object returned by the API appears to have correct 
values. However if I log in to http://www.google.com/analytics and select this 
view, when I click "View Settings" I get the following error:

An illegal state has occurred.
The request resulted in an inappropriate state. Reload the page to see whether 
the problem persists.

Steps to reproduce issue:
Pre: 
service account email and key file location set in script
service account has correct permisisons
Account must exist and property must not - the script creates the property and 
a view under the account 
1. Create property_data.csv 
This should contain at least one line with Existing Account Name, New Property 
Name, URL for Property 
2. Run addAnalyticsProperty.py
3. Log in to https://ww.google.com/analytics
4. Select the view settings for the created view under Account > Web property > 
View > View settings 

Expected output:
View Settings displayed and can be edited

Actual results:
Illegal State error. Unable to view or edit View Settings

Original issue reported on code.google.com by seanmcer...@googlemail.com on 19 Jun 2015 at 3:02

Attachments:

GoogleCodeExporter commented 8 years ago
Thank you for reporting this issue.
It appears that the problem is caused by the leading whitespace in the url " 
http://www.example.com"

A workaround would be to simply strip the leading whitespace. We will update 
the issue when a fix is in place.

Original comment by mcoh...@google.com on 23 Jun 2015 at 10:31