1

Can someone give an example of the query to be used?How do we access the acquisitions and then campaign data from that ?

Rocknroll15
  • 53
  • 1
  • 8

1 Answers1

1

The simplest method would be to make an Analytics Reporting API V4 request with the ga:newusers metric and the ga:source, ga:medium, ga:campaign.

POST https://analyticsreporting.googleapis.com/v4/reports:batchGet
{
  "reportRequests": 
  [
    {
      "viewId": "1174",
      "dateRanges": 
      [
        {
          "startDate": "2014-11-01",
          "endDate": "2014-11-30"
        }
      ],
      "metrics": 
      [
        {
          "expression": "ga:newusers"
        }
      ],
      "dimensions": 
      [
        {
          "name": "ga:campaign"
        },
        {
          "name": "ga:source"
        },
        {
          "name": "ga:medium"
        }
      ]
    }
  ]
}

And again in the API Explorer.

The API also allows you to construct a cohort request to measure engagement overtime.

If you are new to Google's APIs, they make available many client libraries as well as set of quickstart guides.

Matt
  • 5,028
  • 2
  • 28
  • 55
  • Thanks Matt! For anyone else looking for a solution, there is a dimension called ga:acquisitionCampaign which helps you get the acquisition-campaign data. – Rocknroll15 Jun 06 '16 at 16:47