javascript - Display Google Analytics data on my web site? -


I am trying to find a way to display data collected from Google Analytics on my website. I am using NopCommerce, and I want to display this information / data in a view in the admin section.

There are several ways to get this, and after searching the web I found some examples of using javascript, but I could not find a good tutorial for this.

I also considered integrating Google Analytics with C #, and I found this example: a demo project can be downloaded from GitHub here:

However The demo project does not seem to be working because Google URL is no longer in use.

As I am using an MVC application, doing so would make it better to apply Google Analytics logic within a controller and display it in a scene or something like that.

Google provides a query tool to use here, so it should not be difficult to remove data from Google Analytics and display data on website:

Does anyone Is also able to display Google Analytics data successfully on your website?

The problem with someone else is what I did and a lot of answers to this question gives.

1.

There is a basic code for API Clients that access data from Google Analytics via your Google service account

* Google Analytics Account - Once a "tracker" has been registered, in order to make this application work you need to prepare several things before you start coding. "The code has been prepared to put all the webpages you track on. You can not see any statistics now, and it can take up to 24 hours before any statistics can be shown in the Google Analytics dashboard.

CLIENT_ID, an OAuth authorization (API-key) with customer secret and email is not your usual email, but a service account email that was created for you when you create an OAuth authorization). Console.de Velopers.google.com /

A server can also be created here: console.developers.google.com/ You can also create a browser key, though it has not bothered with it and it Do not know what this does.

Finally you need a certificate key. Your app will be able to access your Google Analytics account using only the key and credentials. The key is an encrypted p.12 file You can get the key inside Here's a guide to the key:

2.

Now when you need keys and credentials , It's time to see the code written in "1". The basic base for this is again:

Create a console application and implement the above code.

Note: You are not creating "Google Plus Service", so you have to change those parts of the Google APIs Library for "AnalyticsService"

  • Google APIs Library Library
  • Google APIs Client Library
    • Google GData Extension Library
    • Google API Analytics V3 Library
    • The Google GData client (This data, metrics, analytics

    forgot anything but here's the name that I use:

    System> System.Collections.Generic; using System.Linq; Using System.Text; Using System; Threading Task; System.Security.Cryptography.X509 Using certificates; Using Google.Apis.Auth.OAuth2; Google.Apis.Services; By using Google.Apis.Analytics.v3;

    3

    Finally, this is my code Note that this is the main difference I am creating a new Analytics in accordance with Google's Code "New Service Authority Certificate":

    With this I am capable of accessing and querying data from Google Analytics account The best part is that you do not have to log in to Google because key and credentials give you access to account data directly.

    I will migrate this code to MVC Now, I update later about how to implement the MVC this Analytics client.


    Comments