google-analytics icon indicating copy to clipboard operation
google-analytics copied to clipboard

Chart as "rendered" but is not visible

Open evanrooijen opened this issue 9 years ago • 19 comments

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/

evanrooijen avatar Jun 10 '15 18:06 evanrooijen

Does the demo work for you?

philipwalton avatar Jun 10 '15 19:06 philipwalton

Yes the demo works

evanrooijen avatar Jun 10 '15 20:06 evanrooijen

Ok, then you're going to need to give me more details. Can you link to an example or post your code?

philipwalton avatar Jun 10 '15 20:06 philipwalton

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

roberthallatt avatar Jun 11 '15 13:06 roberthallatt

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?

philipwalton avatar Jun 11 '15 20:06 philipwalton

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

atotic avatar Jun 12 '15 00:06 atotic

Hey @atotic I'm still seeing this issue, now on the live demo: http://googlewebcomponents.github.io/google-analytics/components/google-analytics/demo/

philipwalton avatar Jun 29 '15 01:06 philipwalton

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.

atotic avatar Jul 06 '15 19:07 atotic

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.

ebidel avatar Jul 09 '15 22:07 ebidel

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?

emfluenceindia avatar Nov 17 '15 06:11 emfluenceindia

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.

philipwalton avatar Nov 17 '15 06:11 philipwalton

There is no relevant error in console I could see. However, I don't have anywhere. When I installed google-chart component this got installed for Polymer Starter Kit (after I made the choice of !1). How would I use it?

emfluenceindia avatar Nov 17 '15 06:11 emfluenceindia

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

philipwalton avatar Nov 17 '15 06:11 philipwalton

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>

emfluenceindia avatar Nov 17 '15 13:11 emfluenceindia

Open your Google Developer Console, then under API Manager > Credentials, you can create new Client IDs!

MeTaNoV avatar Nov 17 '15 13:11 MeTaNoV

@emfluenceindia here are some step-by-step instructions: https://developers.google.com/api-client-library/javascript/start/start-js#Setup

philipwalton avatar Nov 17 '15 19:11 philipwalton

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.

klan avatar Oct 11 '16 12:10 klan

image

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.

ravenreaving avatar Dec 21 '16 12:12 ravenreaving

is this component really working based on polymer 1.7 release ?

vka1000 avatar Jan 20 '17 20:01 vka1000