How do I display Google Analytics results on my website?

2

I've been using Google Analytics for some time, but now I wanted to show the results on one page. I'm having some problems noticing how it works. I would like you to advise me a guide / tutorial or to explain how to use it.

    
asked by anonymous 28.02.2014 / 11:49

2 answers

2

a tutorial about using the Analytics API, available for Java, Python, PHP, and JavaScript.

There are also libraries that make it easy to use their API: google-api-php-client from Google itself (there's a tutorial from it in that OS response), the gapi-google-analytics-php-interface and a Google-Analytics-API-PHP , among others >.

    
28.02.2014 / 12:21
1

The ideal is to create a widget that shows the statistics you want only by inserting some HTML and JavaScript that makes AJAX requests to get the data to display.

But it is safer for this widget to access a PHP script on your server, rather than accessing the Google Analytics API directly because you do not want third parties to access any statistics on your site.

There are several ready-made PHP components to do just that, for example the SmartGAPI . This component both generates HTML and JavaScript to insert into your pages, but also processes AJAX requests to forward to the Google Analytics API.

    
02.03.2014 / 22:38