# Get conversions

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

Retrieve Google Ads conversion actions for a location. The response shape is selected by `type`. When `type` is `AD_MANAGER`: without `limit` a plain array of full conversion actions, and with `limit` (max 100, default 100) a paginated `{ conversions, paging }` envelope — pass `pageToken` (from `paging.next`) for the next batch. When `type` is omitted or `AD_WORDS`, a different, minimal snake_case projection is returned and `limit`, `pageToken`, `startDate`, `endDate`, `conversionType` and `category` are all ignored.

## 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 |
| `type` | string | No | Integration type |
| `conversionType` | string | No | Conversion action type to filter by |
| `category` | string | No | Conversion action category to filter by |
| `startDate` | string | No | Filter start date |
| `endDate` | string | No | Filter end date |
| `limit` | string | No | Page size for a paginated fetch (max 100, defaults to 100). When set, the response is a { conversions, paging } envelope instead of a plain array. Applies to AD_MANAGER type only. |
| `pageToken` | string | No | Opaque cursor for the next batch, taken from the previous response paging.next |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "2021-07-28"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/ad-publishing/google/conversions": {
      "get": {
        "summary": "Get conversions",
        "operationId": "getConversions",
        "description": "Retrieve Google Ads conversion actions for a location. The response shape is selected by `type`. When `type` is `AD_MANAGER`: without `limit` a plain array of full conversion actions, and with `limit` (max 100, default 100) a paginated `{ conversions, paging }` envelope — pass `pageToken` (from `paging.next`) for the next batch. When `type` is omitted or `AD_WORDS`, a different, minimal snake_case projection is returned and `limit`, `pageToken`, `startDate`, `endDate`, `conversionType` and `category` are all ignored.",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "2021-07-28"
              ]
            }
          },
          {
            "name": "locationId",
            "required": true,
            "in": "query",
            "description": "Location identifier",
            "schema": {
              "example": "loc_abc123",
              "type": "string"
            }
          },
          {
            "name": "type",
            "required": false,
            "in": "query",
            "description": "Integration type",
            "schema": {
              "example": "AD_MANAGER",
              "enum": [
                "AD_MANAGER",
                "AD_WORDS"
              ],
              "type": "string"
            }
          },
          {
            "name": "conversionType",
            "required": false,
            "in": "query",
            "description": "Conversion action type to filter by",
            "schema": {
              "example": "WEBPAGE",
              "enum": [
                "UPLOAD_CLICKS",
                "UPLOAD_CALLS",
                "WEBPAGE",
                "LEAD_FORM_SUBMIT",
                "AD_CALL"
              ],
              "type": "string"
            }
          },
          {
            "name": "category",
            "required": false,
            "in": "query",
            "description": "Conversion action category to filter by",
            "schema": {
              "example": "PURCHASE",
              "enum": [
                "DEFAULT",
                "PAGE_VIEW",
                "PURCHASE",
                "SIGNUP",
                "LEAD",
                "DOWNLOAD",
                "ADD_TO_CART",
                "BEGIN_CHECKOUT",
                "SUBSCRIBE_PAID",
                "PHONE_CALL_LEAD",
                "IMPORTED_LEAD",
                "SUBMIT_LEAD_FORM",
                "BOOK_APPOINTMENT",
                "REQUEST_QUOTE",
                "GET_DIRECTIONS",
                "OUTBOUND_CLICK",
                "CONTACT",
                "ENGAGEMENT",
                "STORE_VISIT",
                "STORE_SALE",
                "QUALIFIED_LEAD",
                "CONVERTED_LEAD"
              ],
              "type": "string"
            }
          },
          {
            "name": "startDate",
            "required": false,
            "in": "query",
            "description": "Filter start date",
            "schema": {
              "example": "2024-01-01",
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "required": false,
            "in": "query",
            "description": "Filter end date",
            "schema": {
              "example": "2024-12-31",
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Page size for a paginated fetch (max 100, defaults to 100). When set, the response is a { conversions, paging } envelope instead of a plain array. Applies to AD_MANAGER type only.",
            "schema": {
              "example": "100",
              "type": "string"
            }
          },
          {
            "name": "pageToken",
            "required": false,
            "in": "query",
            "description": "Opaque cursor for the next batch, taken from the previous response paging.next",
            "schema": {
              "example": "100",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Minimal array when type is omitted/AD_WORDS, a full array for AD_MANAGER, or a { conversions, paging } envelope for AD_MANAGER with limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetConversionsResponse"
                }
              }
            }
          },
          "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": {
      "GetConversionsResponse": {
        "oneOf": [
          {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "conversion_action_id": {
                  "type": "string",
                  "description": "Google Ads conversion action id",
                  "example": "7086809727"
                },
                "conversion_name": {
                  "type": "string",
                  "description": "Conversion action name",
                  "example": "Offline purchase"
                },
                "conversion_source": {
                  "type": "string",
                  "description": "Always `UPLOAD` on this branch",
                  "example": "UPLOAD"
                }
              },
              "required": [
                "conversion_action_id",
                "conversion_name",
                "conversion_source"
              ],
              "title": "GoogleAdwordsConversionDTO"
            }
          },
          {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Google Ads conversion action id",
                  "example": "7618389481"
                },
                "resourceName": {
                  "type": "string",
                  "description": "Google Ads resource name",
                  "example": "customers/6776452901/conversionActions/7618389481"
                },
                "name": {
                  "type": "string",
                  "description": "Conversion action name",
                  "example": "Offline purchase"
                },
                "status": {
                  "type": "string",
                  "description": "Conversion action status",
                  "example": "ENABLED"
                },
                "type": {
                  "type": "string",
                  "description": "Conversion action type",
                  "enum": [
                    "UPLOAD_CLICKS",
                    "UPLOAD_CALLS",
                    "WEBPAGE",
                    "LEAD_FORM_SUBMIT",
                    "AD_CALL"
                  ],
                  "example": "UPLOAD_CLICKS"
                },
                "countingType": {
                  "type": "string",
                  "description": "How conversions are counted per click",
                  "enum": [
                    "ONE_PER_CLICK",
                    "MANY_PER_CLICK"
                  ],
                  "example": "ONE_PER_CLICK"
                },
                "defaultValue": {
                  "type": "number",
                  "description": "Default conversion value, 0 when unset",
                  "example": 5
                },
                "defaultCurrencyCode": {
                  "type": "string",
                  "description": "ISO currency for the default value. `XXX` is the ISO code for \"no currency\" and appears when unset.",
                  "example": "USD"
                },
                "includeInConversionsMetric": {
                  "type": "boolean",
                  "description": "Whether this action feeds the Conversions reporting metric",
                  "example": true
                },
                "allConversions": {
                  "type": "number",
                  "description": "All-conversions count for the requested window",
                  "example": 0
                },
                "allConversionsValue": {
                  "type": "number",
                  "description": "All-conversions value for the requested window",
                  "example": 0
                },
                "category": {
                  "type": "string",
                  "description": "Conversion action category",
                  "enum": [
                    "DEFAULT",
                    "PAGE_VIEW",
                    "PURCHASE",
                    "SIGNUP",
                    "LEAD",
                    "DOWNLOAD",
                    "ADD_TO_CART",
                    "BEGIN_CHECKOUT",
                    "SUBSCRIBE_PAID",
                    "PHONE_CALL_LEAD",
                    "IMPORTED_LEAD",
                    "SUBMIT_LEAD_FORM",
                    "BOOK_APPOINTMENT",
                    "REQUEST_QUOTE",
                    "GET_DIRECTIONS",
                    "OUTBOUND_CLICK",
                    "CONTACT",
                    "ENGAGEMENT",
                    "STORE_VISIT",
                    "STORE_SALE",
                    "QUALIFIED_LEAD",
                    "CONVERTED_LEAD"
                  ],
                  "example": "CONVERTED_LEAD"
                },
                "primaryForGoal": {
                  "type": "boolean",
                  "description": "Whether the action is primary for its conversion goal",
                  "example": true
                }
              },
              "required": [
                "id",
                "resourceName",
                "name",
                "status",
                "type",
                "countingType",
                "defaultValue",
                "defaultCurrencyCode",
                "includeInConversionsMetric",
                "allConversions",
                "allConversionsValue",
                "category",
                "primaryForGoal"
              ],
              "title": "GoogleConversionActionDTO"
            }
          },
          {
            "type": "object",
            "properties": {
              "conversions": {
                "description": "Page of conversion actions",
                "example": [
                  {
                    "id": "7618389481",
                    "resourceName": "customers/6776452901/conversionActions/7618389481",
                    "name": "Offline purchase",
                    "status": "ENABLED",
                    "type": "UPLOAD_CLICKS",
                    "countingType": "ONE_PER_CLICK",
                    "defaultValue": 5,
                    "defaultCurrencyCode": "USD",
                    "includeInConversionsMetric": true,
                    "allConversions": 0,
                    "allConversionsValue": 0,
                    "category": "CONVERTED_LEAD",
                    "primaryForGoal": true
                  }
                ],
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Google Ads conversion action id",
                      "example": "7618389481"
                    },
                    "resourceName": {
                      "type": "string",
                      "description": "Google Ads resource name",
                      "example": "customers/6776452901/conversionActions/7618389481"
                    },
                    "name": {
                      "type": "string",
                      "description": "Conversion action name",
                      "example": "Offline purchase"
                    },
                    "status": {
                      "type": "string",
                      "description": "Conversion action status",
                      "example": "ENABLED"
                    },
                    "type": {
                      "type": "string",
                      "description": "Conversion action type",
                      "enum": [
                        "UPLOAD_CLICKS",
                        "UPLOAD_CALLS",
                        "WEBPAGE",
                        "LEAD_FORM_SUBMIT",
                        "AD_CALL"
                      ],
                      "example": "UPLOAD_CLICKS"
                    },
                    "countingType": {
                      "type": "string",
                      "description": "How conversions are counted per click",
                      "enum": [
                        "ONE_PER_CLICK",
                        "MANY_PER_CLICK"
                      ],
                      "example": "ONE_PER_CLICK"
                    },
                    "defaultValue": {
                      "type": "number",
                      "description": "Default conversion value, 0 when unset",
                      "example": 5
                    },
                    "defaultCurrencyCode": {
                      "type": "string",
                      "description": "ISO currency for the default value. `XXX` is the ISO code for \"no currency\" and appears when unset.",
                      "example": "USD"
                    },
                    "includeInConversionsMetric": {
                      "type": "boolean",
                      "description": "Whether this action feeds the Conversions reporting metric",
                      "example": true
                    },
                    "allConversions": {
                      "type": "number",
                      "description": "All-conversions count for the requested window",
                      "example": 0
                    },
                    "allConversionsValue": {
                      "type": "number",
                      "description": "All-conversions value for the requested window",
                      "example": 0
                    },
                    "category": {
                      "type": "string",
                      "description": "Conversion action category",
                      "enum": [
                        "DEFAULT",
                        "PAGE_VIEW",
                        "PURCHASE",
                        "SIGNUP",
                        "LEAD",
                        "DOWNLOAD",
                        "ADD_TO_CART",
                        "BEGIN_CHECKOUT",
                        "SUBSCRIBE_PAID",
                        "PHONE_CALL_LEAD",
                        "IMPORTED_LEAD",
                        "SUBMIT_LEAD_FORM",
                        "BOOK_APPOINTMENT",
                        "REQUEST_QUOTE",
                        "GET_DIRECTIONS",
                        "OUTBOUND_CLICK",
                        "CONTACT",
                        "ENGAGEMENT",
                        "STORE_VISIT",
                        "STORE_SALE",
                        "QUALIFIED_LEAD",
                        "CONVERTED_LEAD"
                      ],
                      "example": "CONVERTED_LEAD"
                    },
                    "primaryForGoal": {
                      "type": "boolean",
                      "description": "Whether the action is primary for its conversion goal",
                      "example": true
                    }
                  },
                  "required": [
                    "id",
                    "resourceName",
                    "name",
                    "status",
                    "type",
                    "countingType",
                    "defaultValue",
                    "defaultCurrencyCode",
                    "includeInConversionsMetric",
                    "allConversions",
                    "allConversionsValue",
                    "category",
                    "primaryForGoal"
                  ],
                  "title": "GoogleConversionActionDTO"
                }
              },
              "paging": {
                "description": "Pagination cursor",
                "example": {
                  "next": "40"
                },
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "next": {
                        "type": "string",
                        "description": "Offset cursor for the next page, or null when there are no more pages",
                        "example": "40",
                        "nullable": true
                      }
                    },
                    "required": [
                      "next"
                    ],
                    "title": "GoogleConversionsPagingDTO"
                  }
                ]
              }
            },
            "required": [
              "conversions",
              "paging"
            ],
            "title": "PaginatedGoogleConversionsDTO"
          }
        ]
      },
      "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/conversions?locationId=<LOCATIONID>' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: 2021-07-28'
```

**Node.js**

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

try {
  const response = await fetch('https://services.leadconnectorhq.com/ad-publishing/google/conversions?locationId=<LOCATIONID>', 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/conversions"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "2021-07-28"
}

params = {
    "locationId": "<LOCATIONID>"
}

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/conversions?locationId=<LOCATIONID>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: 2021-07-28',
  ],
]);

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

**Java**

```java
HttpResponse<String> response = Unirest
  .get("https://services.leadconnectorhq.com/ad-publishing/google/conversions?locationId=<LOCATIONID>")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "2021-07-28")
  .asString();
```

**Go**

```go
package main

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

func main() {
  url := "https://services.leadconnectorhq.com/ad-publishing/google/conversions?locationId=<LOCATIONID>"
  req, _ := http.NewRequest("GET", url, nil)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "2021-07-28")

  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/conversions?locationId=<LOCATIONID>")

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

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

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

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "2021-07-28"
}

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/ad-publishing/google/conversions?locationId=<LOCATIONID>' -Method 'GET' -Headers $headers
$response | ConvertTo-Json
```
