> Documentation index: https://docs.zernio.com/llms.txt. Every page is also Markdown: add .md to its URL.

# URL tracking tags

Read and update a Google campaign's tracking template and final URL suffix through GET and PATCH /v1/ads/{adId}/tracking-tags.

By the end of this page, a Google campaign's click URLs carry your tracking template and final URL suffix.

## Read the parameters

A campaign carries two click-URL parameters:

- `trackingUrlTemplate` is the redirect or tracking template, and must contain `{lpurl}`.
- `finalUrlSuffix` is the parse-only `key=value` params appended to the landing page. It is the part that survives parallel tracking.

Both live at the campaign level. You operate on them through the ad endpoints, by passing any ad in the campaign.

These are click-URL parameters, not the site tag. The Google tag (`AW-<id>`) you install on a website, with its conversion labels, is on [Google tag](/platforms/google-ads/tracking-tag).

Call `GET /v1/ads/{adId}/tracking-tags` with the Zernio `_id` of an ad in the campaign.

<Tabs items={['Node.js', 'Python', 'curl']}>
<Tab value="Node.js">
```typescript
import Zernio from '@zernio/node';

const zernio = new Zernio();

const { data: tags } = await zernio.trackingtags.getAdTrackingTags({
  path: { adId: '66f0a1b2c3d4e5f6a7b8c9d0' }
});

console.log(tags.trackingUrlTemplate);
```
</Tab>
<Tab value="Python">
```python
from zernio import Zernio

client = Zernio()

tags = client.tracking_tags.get_ad_tracking_tags(ad_id="66f0a1b2c3d4e5f6a7b8c9d0")

print(tags["trackingUrlTemplate"])
```
</Tab>
<Tab value="curl">
```bash
curl "https://zernio.com/api/v1/ads/66f0a1b2c3d4e5f6a7b8c9d0/tracking-tags" \
  -H "Authorization: Bearer $ZERNIO_API_KEY"
```
</Tab>
</Tabs>

Response (`200`):

```json
{
  "platform": "google",
  "level": "campaign",
  "trackingUrlTemplate": "{lpurl}?utm_source=google",
  "finalUrlSuffix": "utm_medium=cpc"
}
```

## Update either field

Call `PATCH /v1/ads/{adId}/tracking-tags` with only the fields you want to change. Omit a field to leave it untouched, or pass an empty string to clear it.

<Tabs items={['Node.js', 'Python', 'curl']}>
<Tab value="Node.js">
```typescript
const { data: updated } = await zernio.trackingtags.updateAdTrackingTags({
  path: { adId: '66f0a1b2c3d4e5f6a7b8c9d0' },
  body: {
    trackingUrlTemplate: '{lpurl}?utm_source=google&utm_campaign={campaignid}',
    finalUrlSuffix: 'utm_medium=cpc'
  }
});

console.log(updated.trackingUrlTemplate);
```
</Tab>
<Tab value="Python">
```python
updated = client.tracking_tags.update_ad_tracking_tags(
    ad_id="66f0a1b2c3d4e5f6a7b8c9d0",
    tracking_url_template="{lpurl}?utm_source=google&utm_campaign={campaignid}",
    final_url_suffix="utm_medium=cpc",
)

print(updated["trackingUrlTemplate"])
```
</Tab>
<Tab value="curl">
```bash
curl -X PATCH "https://zernio.com/api/v1/ads/66f0a1b2c3d4e5f6a7b8c9d0/tracking-tags" \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "trackingUrlTemplate": "{lpurl}?utm_source=google&utm_campaign={campaignid}",
    "finalUrlSuffix": "utm_medium=cpc"
  }'
```
</Tab>
</Tabs>

Response (`200`):

```json
{
  "platform": "google",
  "level": "campaign",
  "trackingUrlTemplate": "{lpurl}?utm_source=google&utm_campaign={campaignid}",
  "finalUrlSuffix": "utm_medium=cpc"
}
```

Both calls go straight to Google, against the developer-token quota Zernio shares across all customers.

They do not pass the per-user burst limit that gates GAQL and Keyword Planner ([quotas](/platforms/google-ads/reference#quotas-and-the-ops-budget)).

A one-off audit is fine. Before auditing tags across a large number of campaigns, contact support so the capacity is provisioned.

## If it fails

| Error | Cause | Fix |
|---|---|---|
| `platform_api_error` with `MISSING_TRACKING_URL_TEMPLATE_TAG` | The template has no `{lpurl}`, which Google requires | Put `{lpurl}` back and send the `PATCH` again |
| `platform_api_error` with `MALFORMED_TRACKING_URL_TEMPLATE` | The template is not a URL | Send a valid URL template |
| `platform_api_error` with `INVALID_TAG_IN_TRACKING_URL_TEMPLATE` | The template uses a macro Google does not know | Use Google's own macros |
| `404` | `adId` is not an ad on one of your connected accounts | Pass the Zernio `_id` of an ad in the campaign |

A template without `{lpurl}` comes back as a forwarded platform error carrying Google's own code and message. The campaign keeps the template it had:

```json
{
  "error": "Google Ads API error (400): The tracking url template must contain at least one tag (for example, {lpurl}).",
  "type": "platform_error",
  "code": "platform_api_error",
  "platform": "google",
  "platformError": {
    "code": 3,
    "message": "Request contains an invalid argument.",
    "details": [
      {
        "errors": [
          {
            "errorCode": { "urlFieldError": "MISSING_TRACKING_URL_TEMPLATE_TAG" },
            "message": "The tracking url template must contain at least one tag (for example, {lpurl})."
          }
        ]
      }
    ]
  }
}
```

Read the code from `platformError.details[0].errors[0].errorCode`.

## Related

- [Conversions](/platforms/google-ads/conversions): server-side conversion events for the same campaigns.
- [Google tag](/platforms/google-ads/tracking-tag): the site tag and its conversion labels, which is a different thing.
- [LinkedIn tracking tags](/platforms/linkedin-ads/url-tracking) and [Meta Ads tracking tags](/platforms/meta-ads/url-tracking): the same endpoint on the other networks.
- [Get ad tracking tags](/tracking-tags/get-ad-tracking-tags) and [Set ad tracking tags](/tracking-tags/update-ad-tracking-tags): every field.