Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google analytics #108

Closed
DanisHack opened this issue Nov 29, 2013 · 8 comments
Closed

Google analytics #108

DanisHack opened this issue Nov 29, 2013 · 8 comments
Assignees
Labels
🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@DanisHack
Copy link

I m trying to create a VIEW using new management api, but i m getting a badrequest error with msg, "The tracking type of the profile and its parent property should be consistent". Please throw some light on this.

@rakyll
Copy link
Contributor

rakyll commented Nov 29, 2013

Could you send a snippet please?

@DanisHack
Copy link
Author

function CreateView(AccountId, WebProperty, siteUrl, callback){
var params= {'accountId': AccountId, 'webPropertyId':WebProperty};
var body= { "name": "DashBoard1", "websiteUrl":siteUrl,
"type":"WEB", "siteSearchQueryParameters":"ga_search_query",
"siteSearchCategoryParameters":"ga_search_type"
};
gapi.mainclient.analytics.management.profiles.insert(params, body)
.withAuthClient(gapi.client)
.execute(function(err, result){
if(err){
callback(err, null);
}
else if(result){
var viewid = result.id;
callback(null, viewid);
}
});
}

@rakyll
Copy link
Contributor

rakyll commented Nov 29, 2013

Is your parent web property app-based? Could you get the web property details and tell me what's the websiteUrl? If the parent is not a Web tracking property, you can't create a Web tracking profile underneath.

@DanisHack
Copy link
Author

my webproperty details-----

{ id: 'UA-460104-10',
kind: 'analytics#webproperty',
selfLink: 'https://www.googleapis.com/analytics/v3/management/accounts/460**104/webproperties/UA-460**104-10',
accountId: '460
104',
internalWebPropertyId: '77_**200',
name: 'website_Data',
level: 'STANDARD',
profileCount: 0,
industryVertical: 'SHOPPING',
permissions: { effective: [ 'COLLABORATE', 'EDIT', 'MANAGE_USERS', 'READ_AND_ANALYZE' ] },
created: '2013-11-29T11:02:37.910Z',
updated: '2013-11-29T11:02:37.910Z',
parentLink:
{ type: 'analytics#account',
href: 'https://www.googleapis.com/analytics/v3/management/accounts/460__104' },
childLink:
{ type: 'analytics#profiles',
href: 'https://www.googleapis.com/analytics/v3/management/accounts/460__104/webproperties/UA-460_*104-10/profiles' } }

@DanisHack
Copy link
Author

Above is a response i get, when i create a new webproperty using api. No my webproperty is WEB based and websiteUrl is http://ot.com (for testing purpose). i suppose above property is Web tracking property. To me error msg is unclear. Thanks

@DanisHack
Copy link
Author

ERROR:

{ errors:
[ { domain: 'global',
reason: 'badRequest',
message: 'The tracking type of the profile and its parent property should be consistent.' } ],
code: 400,
message: 'The tracking type of the profile and its parent property should be consistent.' }

@rakyll
Copy link
Contributor

rakyll commented Nov 29, 2013

You should be able to see websiteUrl: "http://ot.com" on the JSON payload above if it's a Web tracking property. It looks like there is an issue with the API, rather than the client library particularly. Could you email the Management API's mailing list [1] to get in touch with the Analytics guys? Btw, it should be reproducible on the API Explorer [2].

[1] https://groups.google.com/forum/?fromgroups#!forum/google-analytics-management-api
[2] https://developers.google.com/apis-explorer/#p/analytics/v3/

@DanisHack
Copy link
Author

yeah i was expecting websiteUrl: "http://ot.com" in my response. but i didn't get. i'll look into the issue. I follow this group, so will try to dig deep.

Thanks a lot, rakyll

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

3 participants