# Get reporting data

GET https://services.leadconnectorhq.com/ad-publishing/google/reporting

Retrieve aggregated Google Ads reporting metrics for a location

## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `adPublishing.readonly`

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version |

### Query Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `locationId` | string | Yes | Location identifier |
| `fields` | array | Yes | Reporting fields. Pass as comma-separated values on the wire (e.g. ?fields=impressions,clicks). |
| `groupBy` | string | No | Group by period |
| `startDate` | string | Yes | Report start date |
| `endDate` | string | Yes | Report end date |
| `type` | string | Yes | Integration type |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "v3"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/ad-publishing/google/reporting": {
      "get": {
        "summary": "Get reporting data",
        "operationId": "getReportingData",
        "description": "Retrieve aggregated Google Ads reporting metrics for a location",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "v3"
              ]
            }
          },
          {
            "name": "locationId",
            "required": true,
            "in": "query",
            "description": "Location identifier",
            "schema": {
              "example": "fRMewNQIxSyZ5R4nQyit",
              "type": "string"
            }
          },
          {
            "name": "fields",
            "required": true,
            "in": "query",
            "description": "Reporting fields. Pass as comma-separated values on the wire (e.g. ?fields=impressions,clicks).",
            "schema": {
              "example": [
                "impressions",
                "clicks",
                "cost_micros"
              ],
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "impressions",
                  "clicks",
                  "cost_micros",
                  "average_cpc",
                  "conversions",
                  "average_cpm",
                  "cost_per_conversion",
                  "ctr"
                ]
              }
            }
          },
          {
            "name": "groupBy",
            "required": false,
            "in": "query",
            "description": "Group by period",
            "schema": {
              "example": "month",
              "enum": [
                "date",
                "week",
                "month"
              ],
              "type": "string"
            }
          },
          {
            "name": "startDate",
            "required": true,
            "in": "query",
            "description": "Report start date",
            "schema": {
              "example": "2022-01-11",
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "required": true,
            "in": "query",
            "description": "Report end date",
            "schema": {
              "example": "2022-01-31",
              "type": "string"
            }
          },
          {
            "name": "type",
            "required": true,
            "in": "query",
            "description": "Integration type",
            "schema": {
              "example": "INTEGRATION",
              "enum": [
                "AD_MANAGER",
                "INTEGRATION"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Metrics grouped by the requested interval, plus totals. Only the requested `fields` appear.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoogleReportingResponseDTO"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestDTO"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedDTO"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnprocessableDTO"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerErrorDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [
              "adPublishing.readonly"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      },
      "Agency-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "GoogleReportingResponseDTO": {
        "type": "object",
        "properties": {
          "grouped": {
            "description": "One entry per time bucket",
            "example": [
              {
                "segments": {
                  "week": "2026-08-03"
                },
                "metrics": {
                  "impressions": 6041,
                  "clicks": 180,
                  "costMicros": 5421341,
                  "averageCpc": 864547.05,
                  "conversions": 0,
                  "averageCpm": 25877259.57,
                  "costPerConversion": 0,
                  "ctr": 0.115
                }
              }
            ],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "segments": {
                  "type": "object",
                  "description": "The bucket this row covers. The key follows `groupBy` — `date`, `week` or `month` — and the value is the first day of the bucket.",
                  "additionalProperties": {
                    "type": "string"
                  },
                  "example": {
                    "week": "2026-08-03"
                  }
                },
                "metrics": {
                  "description": "Metrics for the bucket",
                  "example": {
                    "impressions": 6041,
                    "clicks": 180,
                    "costMicros": 5421341,
                    "averageCpc": 864547.05,
                    "conversions": 0,
                    "averageCpm": 25877259.57,
                    "costPerConversion": 0,
                    "ctr": 0.115
                  },
                  "allOf": [
                    {
                      "type": "object",
                      "properties": {
                        "impressions": {
                          "description": "Impressions",
                          "oneOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "example": 6041
                        },
                        "clicks": {
                          "description": "Clicks",
                          "oneOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "example": 180
                        },
                        "costMicros": {
                          "description": "Spend in micros — divide by 1,000,000 for account currency",
                          "oneOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "example": 5421341
                        },
                        "averageCpc": {
                          "type": "number",
                          "description": "Average cost per click, in micros",
                          "example": 864547.05
                        },
                        "conversions": {
                          "type": "number",
                          "description": "Conversions",
                          "example": 0
                        },
                        "averageCpm": {
                          "type": "number",
                          "description": "Average cost per thousand impressions, in micros",
                          "example": 25877259.57
                        },
                        "costPerConversion": {
                          "type": "number",
                          "description": "Cost per conversion, in micros",
                          "example": 0
                        },
                        "ctr": {
                          "type": "number",
                          "description": "Click-through rate as a fraction, not a percentage",
                          "example": 0.115
                        }
                      },
                      "title": "GoogleReportingMetricsDTO"
                    }
                  ]
                }
              },
              "required": [
                "segments",
                "metrics"
              ],
              "title": "GoogleReportingGroupDTO"
            }
          },
          "totals": {
            "description": "Metrics summed across every bucket",
            "example": {
              "impressions": 6041,
              "clicks": 180,
              "costMicros": 5421341,
              "averageCpc": 864547.05,
              "conversions": 0,
              "averageCpm": 25877259.57,
              "costPerConversion": 0,
              "ctr": 0.115
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "impressions": {
                    "description": "Impressions",
                    "oneOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "example": 6041
                  },
                  "clicks": {
                    "description": "Clicks",
                    "oneOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "example": 180
                  },
                  "costMicros": {
                    "description": "Spend in micros — divide by 1,000,000 for account currency",
                    "oneOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "example": 5421341
                  },
                  "averageCpc": {
                    "type": "number",
                    "description": "Average cost per click, in micros",
                    "example": 864547.05
                  },
                  "conversions": {
                    "type": "number",
                    "description": "Conversions",
                    "example": 0
                  },
                  "averageCpm": {
                    "type": "number",
                    "description": "Average cost per thousand impressions, in micros",
                    "example": 25877259.57
                  },
                  "costPerConversion": {
                    "type": "number",
                    "description": "Cost per conversion, in micros",
                    "example": 0
                  },
                  "ctr": {
                    "type": "number",
                    "description": "Click-through rate as a fraction, not a percentage",
                    "example": 0.115
                  }
                },
                "title": "GoogleReportingMetricsDTO"
              }
            ]
          }
        },
        "required": [
          "grouped",
          "totals"
        ],
        "title": "GoogleReportingResponseDTO"
      },
      "BadRequestDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 400
          },
          "message": {
            "type": "string",
            "example": "Bad Request"
          }
        },
        "title": "BadRequestDTO"
      },
      "UnauthorizedDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 401
          },
          "message": {
            "type": "string",
            "example": "Invalid token: access token is invalid"
          },
          "error": {
            "type": "string",
            "example": "Unauthorized"
          }
        },
        "title": "UnauthorizedDTO"
      },
      "UnprocessableDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 422
          },
          "message": {
            "example": [
              "Unprocessable Entity"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "type": "string",
            "example": "Unprocessable Entity"
          }
        },
        "title": "UnprocessableDTO"
      },
      "InternalServerErrorDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "description": "HTTP status code for an unexpected server error",
            "example": 500
          },
          "message": {
            "type": "string",
            "description": "Error message describing the server failure",
            "example": "Internal Server Error"
          }
        },
        "title": "InternalServerErrorDTO"
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X GET 'https://services.leadconnectorhq.com/ad-publishing/google/reporting?locationId=<LOCATIONID>&fields=<FIELDS>&startDate=<STARTDATE>&endDate=<ENDDATE>&type=<TYPE>' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: v3'
```

**Node.js**

```javascript
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: 'v3'
  }
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/ad-publishing/google/reporting?locationId=<LOCATIONID>&fields=<FIELDS>&startDate=<STARTDATE>&endDate=<ENDDATE>&type=<TYPE>', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/ad-publishing/google/reporting"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "v3"
}

params = {
    "locationId": "<LOCATIONID>",
    "fields": "<FIELDS>",
    "startDate": "<STARTDATE>",
    "endDate": "<ENDDATE>",
    "type": "<TYPE>"
}

response = requests.get(url, params=params, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/ad-publishing/google/reporting?locationId=<LOCATIONID>&fields=<FIELDS>&startDate=<STARTDATE>&endDate=<ENDDATE>&type=<TYPE>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: v3',
  ],
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .get("https://services.leadconnectorhq.com/ad-publishing/google/reporting?locationId=<LOCATIONID>&fields=<FIELDS>&startDate=<STARTDATE>&endDate=<ENDDATE>&type=<TYPE>")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "v3")
  .asString();
```

**Go**

```go
package main

import (
  "fmt"
  "net/http"
  "io"
)

func main() {
  url := "https://services.leadconnectorhq.com/ad-publishing/google/reporting?locationId=<LOCATIONID>&fields=<FIELDS>&startDate=<STARTDATE>&endDate=<ENDDATE>&type=<TYPE>"
  req, _ := http.NewRequest("GET", url, nil)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "v3")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/ad-publishing/google/reporting?locationId=<LOCATIONID>&fields=<FIELDS>&startDate=<STARTDATE>&endDate=<ENDDATE>&type=<TYPE>")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "v3"

response = http.request(request)
puts response.read_body
```

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "v3"
}

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/ad-publishing/google/reporting?locationId=<LOCATIONID>&fields=<FIELDS>&startDate=<STARTDATE>&endDate=<ENDDATE>&type=<TYPE>' -Method 'GET' -Headers $headers
$response | ConvertTo-Json
```
