How can I extract Google analytics data?

2 views (last 30 days)
Elham Noorzai
Elham Noorzai on 5 Feb 2019
Edited: Elham Noorzai on 6 Feb 2019
I have the client_id the client_secret, the authorization code, but how exactly can I extract data from google analytics. In which format do i have to enter startDate or the endDate?
Mein Code bisher
access_token='XXXX';
headerFields = {'Authorization', ['Bearer ', access_token]};
options = weboptions('HeaderFields', headerFields, 'ContentType','json');
webread('https://www.googleapis.com/analytics/v3/data/ga','ids=ga12345',...
'start-date=2018-12-01','end-date=2019-01-31','metrics=ga:sessions', options)
Unfortunately, the in 2016a the HeaderFields cannot be added into weboptions, any workaround?

Answers (0)

Products


Release

R2016a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!