• 0

Google Analytics Datasource?

Go to solution Solved by David Lee,


1 answer to this question

Recommended Posts

  • 1
  • LogicMonitor Staff
  • Solution

Hi,  You may be interested to know we have 2 Beta datasources

  • Google_Analytics_RealTime_Stats
  • Google_Analytics_PageStats
Which if you contact support can be imported into your account.
The need a  bit of set up

setup for Google Analytics Datasources: Step-by-step guide

(a)The following items must be included in the Device Properties
system.categories -> GoogleAnalytics

(1) Follow these steps in order to get an Access Token and the Refresh Token.
On your browser, log-in at Google with the account you want to use to access Analytics info.

(2) Visit https://code.google.com/apis/console . Click on create a "project". Search for "Analytics API" and click 'Enable'. Afterwards, navigate to Credentials -> OAuth Consent Screen.
Choose the 'email address' and 'Product name shown to users' and save.

(3) Create Credentials -> OAuth Client ID.
Application Type: Other
Input any name (i.e. : LM Client ID)

(4)You should now be presented with a Client ID & Client Secret.

(5) Navigate to the following URL and insert the correct Client ID.
You will be presented with a screen to allow access and code string you will need to copy and save.

(6) Go into a terminal and paste the following cURL command.
curl -H "Content-Type: application/x-www-form-urlencoded" -d 'code=INSERT_CODE_STRING_HERE&client_id=INSERT_CLIENT_ID_HERE&client_secret=INSERT_CLIENT_SECRET_HERE&redirect_uri=urn:ietf:wg:oauth:2.0:oob&grant_type=authorization_code' https://accounts.google.com/o/oauth2/token

(7)The output of the previous cURL command should be a JSON response similar to the following:
"access_token" : "ya29.AH3afsdfasdfjhahskjhskkskjh",
"token_type" : "Bearer",
"expires_in" : 3600,
"refresh_token" : "1/HH9E7dfdf4saf3wah7899a8sd989"

(8)You should now have the ClientID, Client Secret & Refresh Token. Insert these into the device properties to get the datasource properly working.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.