简体   繁体   中英

GET Goals from Google Analytics using API Method with Date Range

I am trying to get the goals from our google analytics account but applying a date range. I haven't seen in the documentation a way to pass a date range for this method. Any help would be appreciated! Thanks!

Testing using their API test page here: https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtReference/management/goals/get

GET https://www.googleapis.com/analytics/v3/management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/goals/goalId

When I pull the request using the their test API page, I am assuming it is only pulling the goal conversions for the day I am making the request, not for all of time.

I think you might be confusing the reporting api with the management api.

If you want to get data out of GA, use the reporting api.

If you want to configure GA or read GA configurations, use the management api.

In your case, you want to REPORT on the goals, but you're using the management api to do so.

You should use the reporting API to get a list of goals completed.

Reporting API reference/documentation: https://developers.google.com/analytics/devguides/reporting/core/v4/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM