Open evanrooijen opened 9 years ago
Does the demo work for you?
Yes the demo works
Ok, then you're going to need to give me more details. Can you link to an example or post your code?
I'm having the same issue. The demo works but my charts won't render on my own server. Here is the URL to see my code - http://www.kidsnewtocanada.ca/stats/test4/bower_components/google-analytics/demo.html
I see, yes I can reproduce this as well when installing the dependencies with the following bower command and then creating an HTML file with the demo code:
bower install googlewebcomponents/google-analytics googlewebcomponents/google-signin
I'm assuming it's a discrepancy with the versions used by the demo and those installed by bower.
@atotic can you look into why the demo works but a fresh install doesn't?
Polymer update broke google-chart. Fix has not made it to google-chart release yet. Will be fixed when this goes in: https://github.com/GoogleWebComponents/google-chart/pull/50
Hey @atotic I'm still seeing this issue, now on the live demo: http://googlewebcomponents.github.io/google-analytics/components/google-analytics/demo/
googlewebcomponents still has an old version of google-chart. The 1.0.2 release was tagged, but not published. I've just published it, next gwc pull should get it.
FWIW, gwc.github.io should be considered deprecated now that we're hosting the elements at https://elements.polymer-project.org/elements/google-analytics?view=demo:demo/index.html&active=google-analytics-query.
The latter works.
The @demo
link was missing from the docs, which is why it wasn't showing up. It's been added but we still need to update the catalog to reflect.
Chart is not showing up for me either! In elements.html I have referenced the following files:
bower_components/google-analytics/google-analytics.html bower_components/google-analytics/google-analytics-query.html bower_components/google-analytics/google-analytics-chart.html bower_components/google-analytics/google-analytics-view-selector.html
and my index.html looks like this:
<google-analytics-chart type="area" ids="ga:88814676" metrics="ga:sessions" dimensions="ga:date" startDate="2015-10-01" endDate="2015-10-31"></google-analytics-chart>
The demo at https://elements.polymer-project.org/elements/google-analytics?view=demo:demo/index.html&active=google-analytics-query however works.
Am I missing something?
Are you getting any errors in the JavaScript console?
Also, do you have the <google-signin>
element anywhere? You have to be authorized to make requests to the Google Analytics APIs.
There is no relevant error in console I could see. However, I don't have
Take a look at the code in the demo file.
Here you can see the <google-signin>
element being used:
https://github.com/GoogleWebComponents/google-analytics/blob/master/demo/index.html#L184-L186
And you'll need to make sure to include it as I have here: https://github.com/GoogleWebComponents/google-analytics/blob/master/demo/index.html#L9
For details on how it works, check out it's docs: https://elements.polymer-project.org/elements/google-signin
Thanks for your reply. But I cannot find a client_id. I have several accounts under my Google Analytics and I want to fetch data from one of these. Is client_id the same for all these accounts or they are different for each?
And also where I should look for this client_id like you have: client-id="1054047045356-j8pgqgls9vdef3rl09hapoicumbte0bo.apps.googleusercontent.com"
Another thing I have noticed that you did not use any "ids", which (probably) means you are not sticking to a particular account. Am I allowed to include an id and a date range to restrict data from a specific account and filtered by the dates?
<google-analytics-chart type="area" ids="ga:88814676" metrics="ga:sessions" dimensions="ga:date" start-date="2015-10-01" end-date="2015-10-31" max-results="5"></google-analytics-chart>
Open your Google Developer Console, then under API Manager > Credentials, you can create new Client IDs!
@emfluenceindia here are some step-by-step instructions: https://developers.google.com/api-client-library/javascript/start/start-js#Setup
Has there been any breaking changes? I can't make the demo at https://elements.polymer-project.org/elements/google-analytics?view=demo:demo/index.html&active=google-analytics-dashboard work. I just get empty view-/date-selectors and charts.
hi i'm using the demo in localhost. i replaced the client id with mine. but this is all i got in the output :( and console errors saying the polymer is not defined.
is this component really working based on polymer 1.7 release ?
I'm following this example but my chartdivs do not show any charts. Authentication flow works fine btw.
https://ga-dev-tools.appspot.com/polymer-elements/