Skip to content

Latest commit

 

History

History
1306 lines (974 loc) · 55.2 KB

File metadata and controls

1306 lines (974 loc) · 55.2 KB

TrackingTagsApi

All URIs are relative to https://zernio.com/api

Method HTTP request Description
addTrackingTagSharedAccount POST /v1/accounts/{accountId}/tracking-tags/{tagId}/shared-accounts Share with an ad account
addTrackingTagSharedAccountWithHttpInfo POST /v1/accounts/{accountId}/tracking-tags/{tagId}/shared-accounts Share with an ad account
createTrackingTag POST /v1/accounts/{accountId}/tracking-tags Create a tracking tag
createTrackingTagWithHttpInfo POST /v1/accounts/{accountId}/tracking-tags Create a tracking tag
getTrackingTag GET /v1/accounts/{accountId}/tracking-tags/{tagId} Get a tracking tag
getTrackingTagWithHttpInfo GET /v1/accounts/{accountId}/tracking-tags/{tagId} Get a tracking tag
getTrackingTagStats GET /v1/accounts/{accountId}/tracking-tags/{tagId}/stats Get aggregated event stats
getTrackingTagStatsWithHttpInfo GET /v1/accounts/{accountId}/tracking-tags/{tagId}/stats Get aggregated event stats
listTrackingTagSharedAccounts GET /v1/accounts/{accountId}/tracking-tags/{tagId}/shared-accounts List accounts it is shared with
listTrackingTagSharedAccountsWithHttpInfo GET /v1/accounts/{accountId}/tracking-tags/{tagId}/shared-accounts List accounts it is shared with
listTrackingTags GET /v1/accounts/{accountId}/tracking-tags List tracking tags
listTrackingTagsWithHttpInfo GET /v1/accounts/{accountId}/tracking-tags List tracking tags
removeTrackingTagSharedAccount DELETE /v1/accounts/{accountId}/tracking-tags/{tagId}/shared-accounts Stop sharing with an account
removeTrackingTagSharedAccountWithHttpInfo DELETE /v1/accounts/{accountId}/tracking-tags/{tagId}/shared-accounts Stop sharing with an account
updateTrackingTag PATCH /v1/accounts/{accountId}/tracking-tags/{tagId} Update a tracking tag
updateTrackingTagWithHttpInfo PATCH /v1/accounts/{accountId}/tracking-tags/{tagId} Update a tracking tag

addTrackingTagSharedAccount

AddTrackingTagSharedAccount201Response addTrackingTagSharedAccount(accountId, tagId, addTrackingTagSharedAccountRequest)

Share with an ad account

Shares the pixel with another ad account so campaigns/audiences in that account can use it. Requires that you administer both the pixel's owning Business Manager and the target ad account; a pixel on a personal (non-BM) ad account can't be shared (Meta will reject the call). Meta only (platform `metaads`); other platforms return 405.

Example

// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.TrackingTagsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://zernio.com/api");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        TrackingTagsApi apiInstance = new TrackingTagsApi(defaultClient);
        String accountId = "accountId_example"; // String | 
        String tagId = "tagId_example"; // String | Pixel id.
        AddTrackingTagSharedAccountRequest addTrackingTagSharedAccountRequest = new AddTrackingTagSharedAccountRequest(); // AddTrackingTagSharedAccountRequest | 
        try {
            AddTrackingTagSharedAccount201Response result = apiInstance.addTrackingTagSharedAccount(accountId, tagId, addTrackingTagSharedAccountRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrackingTagsApi#addTrackingTagSharedAccount");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
accountId String
tagId String Pixel id.
addTrackingTagSharedAccountRequest AddTrackingTagSharedAccountRequest

Return type

AddTrackingTagSharedAccount201Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Tracking tag shared with the ad account -
400 Invalid body / `adAccountId`, or Meta rejected the share (e.g. personal ad account). -
401 Unauthorized -
403 Ads access required (Ads add-on on legacy plans, included on usage-based plans), or the Meta token lacks ads permissions (reconnect required). -
404 Account or tracking tag not found. -
405 Platform does not support shared accounts. -

addTrackingTagSharedAccountWithHttpInfo

ApiResponse addTrackingTagSharedAccount addTrackingTagSharedAccountWithHttpInfo(accountId, tagId, addTrackingTagSharedAccountRequest)

Share with an ad account

Shares the pixel with another ad account so campaigns/audiences in that account can use it. Requires that you administer both the pixel's owning Business Manager and the target ad account; a pixel on a personal (non-BM) ad account can't be shared (Meta will reject the call). Meta only (platform `metaads`); other platforms return 405.

Example

// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.TrackingTagsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://zernio.com/api");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        TrackingTagsApi apiInstance = new TrackingTagsApi(defaultClient);
        String accountId = "accountId_example"; // String | 
        String tagId = "tagId_example"; // String | Pixel id.
        AddTrackingTagSharedAccountRequest addTrackingTagSharedAccountRequest = new AddTrackingTagSharedAccountRequest(); // AddTrackingTagSharedAccountRequest | 
        try {
            ApiResponse<AddTrackingTagSharedAccount201Response> response = apiInstance.addTrackingTagSharedAccountWithHttpInfo(accountId, tagId, addTrackingTagSharedAccountRequest);
            System.out.println("Status code: " + response.getStatusCode());
            System.out.println("Response headers: " + response.getHeaders());
            System.out.println("Response body: " + response.getData());
        } catch (ApiException e) {
            System.err.println("Exception when calling TrackingTagsApi#addTrackingTagSharedAccount");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Response headers: " + e.getResponseHeaders());
            System.err.println("Reason: " + e.getResponseBody());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
accountId String
tagId String Pixel id.
addTrackingTagSharedAccountRequest AddTrackingTagSharedAccountRequest

Return type

ApiResponse<AddTrackingTagSharedAccount201Response>

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Tracking tag shared with the ad account -
400 Invalid body / `adAccountId`, or Meta rejected the share (e.g. personal ad account). -
401 Unauthorized -
403 Ads access required (Ads add-on on legacy plans, included on usage-based plans), or the Meta token lacks ads permissions (reconnect required). -
404 Account or tracking tag not found. -
405 Platform does not support shared accounts. -

createTrackingTag

CreateTrackingTag201Response createTrackingTag(accountId, createTrackingTagRequest)

Create a tracking tag

Creates a Meta Pixel on the given ad account (`POST /act_{id}/adspixels` — `name` is the only input). Returns the created tag including its install `code`. The pixel is owned by the Business Manager that owns the ad account; a pixel created on a personal (non-BM) ad account ends up with `ownerBusinessId: null` and can't be shared with other ad accounts. Creating a pixel does NOT install it — install the returned `code` snippet on the site, or send events server-side via `POST /v1/ads/conversions`. The check `installed` is derived from `lastFiredTime`. NOT idempotent: each call creates a new pixel. Do not retry blindly on timeout. Meta only (platform `metaads`); other platforms return 405.

Example

// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.TrackingTagsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://zernio.com/api");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        TrackingTagsApi apiInstance = new TrackingTagsApi(defaultClient);
        String accountId = "accountId_example"; // String | Meta ads SocialAccount id (platform `metaads`).
        CreateTrackingTagRequest createTrackingTagRequest = new CreateTrackingTagRequest(); // CreateTrackingTagRequest | 
        try {
            CreateTrackingTag201Response result = apiInstance.createTrackingTag(accountId, createTrackingTagRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrackingTagsApi#createTrackingTag");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
accountId String Meta ads SocialAccount id (platform `metaads`).
createTrackingTagRequest CreateTrackingTagRequest

Return type

CreateTrackingTag201Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Tracking tag created -
400 Invalid body, invalid `adAccountId`, over the per-business pixel cap, or ad account not in a Business Manager. -
401 Unauthorized -
403 Ads access required (Ads add-on on legacy plans, included on usage-based plans), or the Meta token lacks ads permissions (reconnect required). -
404 Account not found or not accessible. -
405 Platform does not support creating tracking tags. -

createTrackingTagWithHttpInfo

ApiResponse createTrackingTag createTrackingTagWithHttpInfo(accountId, createTrackingTagRequest)

Create a tracking tag

Creates a Meta Pixel on the given ad account (`POST /act_{id}/adspixels` — `name` is the only input). Returns the created tag including its install `code`. The pixel is owned by the Business Manager that owns the ad account; a pixel created on a personal (non-BM) ad account ends up with `ownerBusinessId: null` and can't be shared with other ad accounts. Creating a pixel does NOT install it — install the returned `code` snippet on the site, or send events server-side via `POST /v1/ads/conversions`. The check `installed` is derived from `lastFiredTime`. NOT idempotent: each call creates a new pixel. Do not retry blindly on timeout. Meta only (platform `metaads`); other platforms return 405.

Example

// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.TrackingTagsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://zernio.com/api");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        TrackingTagsApi apiInstance = new TrackingTagsApi(defaultClient);
        String accountId = "accountId_example"; // String | Meta ads SocialAccount id (platform `metaads`).
        CreateTrackingTagRequest createTrackingTagRequest = new CreateTrackingTagRequest(); // CreateTrackingTagRequest | 
        try {
            ApiResponse<CreateTrackingTag201Response> response = apiInstance.createTrackingTagWithHttpInfo(accountId, createTrackingTagRequest);
            System.out.println("Status code: " + response.getStatusCode());
            System.out.println("Response headers: " + response.getHeaders());
            System.out.println("Response body: " + response.getData());
        } catch (ApiException e) {
            System.err.println("Exception when calling TrackingTagsApi#createTrackingTag");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Response headers: " + e.getResponseHeaders());
            System.err.println("Reason: " + e.getResponseBody());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
accountId String Meta ads SocialAccount id (platform `metaads`).
createTrackingTagRequest CreateTrackingTagRequest

Return type

ApiResponse<CreateTrackingTag201Response>

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Tracking tag created -
400 Invalid body, invalid `adAccountId`, over the per-business pixel cap, or ad account not in a Business Manager. -
401 Unauthorized -
403 Ads access required (Ads add-on on legacy plans, included on usage-based plans), or the Meta token lacks ads permissions (reconnect required). -
404 Account not found or not accessible. -
405 Platform does not support creating tracking tags. -

getTrackingTag

CreateTrackingTag201Response getTrackingTag(accountId, tagId)

Get a tracking tag

Returns the full tag record including the base-code `code` snippet, `lastFiredTime`, `ownerBusinessId`, `isUnavailable`, etc. Meta only (platform `metaads`); other platforms return 405.

Example

// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.TrackingTagsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://zernio.com/api");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        TrackingTagsApi apiInstance = new TrackingTagsApi(defaultClient);
        String accountId = "accountId_example"; // String | 
        String tagId = "tagId_example"; // String | Pixel id.
        try {
            CreateTrackingTag201Response result = apiInstance.getTrackingTag(accountId, tagId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrackingTagsApi#getTrackingTag");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
accountId String
tagId String Pixel id.

Return type

CreateTrackingTag201Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Tracking tag fetched -
401 Unauthorized -
403 Ads access required (Ads add-on on legacy plans, included on usage-based plans), or the Meta token lacks ads permissions (reconnect required). -
404 Account or tracking tag not found. -
405 Platform does not support fetching a tracking tag. -

getTrackingTagWithHttpInfo

ApiResponse getTrackingTag getTrackingTagWithHttpInfo(accountId, tagId)

Get a tracking tag

Returns the full tag record including the base-code `code` snippet, `lastFiredTime`, `ownerBusinessId`, `isUnavailable`, etc. Meta only (platform `metaads`); other platforms return 405.

Example

// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.TrackingTagsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://zernio.com/api");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        TrackingTagsApi apiInstance = new TrackingTagsApi(defaultClient);
        String accountId = "accountId_example"; // String | 
        String tagId = "tagId_example"; // String | Pixel id.
        try {
            ApiResponse<CreateTrackingTag201Response> response = apiInstance.getTrackingTagWithHttpInfo(accountId, tagId);
            System.out.println("Status code: " + response.getStatusCode());
            System.out.println("Response headers: " + response.getHeaders());
            System.out.println("Response body: " + response.getData());
        } catch (ApiException e) {
            System.err.println("Exception when calling TrackingTagsApi#getTrackingTag");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Response headers: " + e.getResponseHeaders());
            System.err.println("Reason: " + e.getResponseBody());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
accountId String
tagId String Pixel id.

Return type

ApiResponse<CreateTrackingTag201Response>

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Tracking tag fetched -
401 Unauthorized -
403 Ads access required (Ads add-on on legacy plans, included on usage-based plans), or the Meta token lacks ads permissions (reconnect required). -
404 Account or tracking tag not found. -
405 Platform does not support fetching a tracking tag. -

getTrackingTagStats

GetTrackingTagStats200Response getTrackingTagStats(accountId, tagId, aggregation, startTime, endTime)

Get aggregated event stats

Returns aggregated event counts for the pixel (`GET /{pixel_id}/stats`). Rows are passed through from Meta as-is — their shape depends on the `aggregation` requested. Meta only (platform `metaads`); other platforms return 405.

Example

// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.TrackingTagsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://zernio.com/api");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        TrackingTagsApi apiInstance = new TrackingTagsApi(defaultClient);
        String accountId = "accountId_example"; // String | 
        String tagId = "tagId_example"; // String | Pixel id.
        String aggregation = "event"; // String | Aggregation dimension. Defaults to `event`.
        Integer startTime = 56; // Integer | Unix seconds lower bound.
        Integer endTime = 56; // Integer | Unix seconds upper bound.
        try {
            GetTrackingTagStats200Response result = apiInstance.getTrackingTagStats(accountId, tagId, aggregation, startTime, endTime);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrackingTagsApi#getTrackingTagStats");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
accountId String
tagId String Pixel id.
aggregation String Aggregation dimension. Defaults to `event`. [optional] [default to event] [enum: event, host, url, url_by_rule, pixel_fire, device_type, device_os, browser_type, had_pii, custom_data_field, match_keys, event_source, event_detection_method, event_processing_results, event_total_counts, event_value_count]
startTime Integer Unix seconds lower bound. [optional]
endTime Integer Unix seconds upper bound. [optional]

Return type

GetTrackingTagStats200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Stats fetched -
400 Invalid query parameter. -
401 Unauthorized -
403 Ads access required (Ads add-on on legacy plans, included on usage-based plans), or the Meta token lacks ads permissions (reconnect required). -
404 Account or tracking tag not found. -
405 Platform does not support tracking-tag stats. -

getTrackingTagStatsWithHttpInfo

ApiResponse getTrackingTagStats getTrackingTagStatsWithHttpInfo(accountId, tagId, aggregation, startTime, endTime)

Get aggregated event stats

Returns aggregated event counts for the pixel (`GET /{pixel_id}/stats`). Rows are passed through from Meta as-is — their shape depends on the `aggregation` requested. Meta only (platform `metaads`); other platforms return 405.

Example

// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.TrackingTagsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://zernio.com/api");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        TrackingTagsApi apiInstance = new TrackingTagsApi(defaultClient);
        String accountId = "accountId_example"; // String | 
        String tagId = "tagId_example"; // String | Pixel id.
        String aggregation = "event"; // String | Aggregation dimension. Defaults to `event`.
        Integer startTime = 56; // Integer | Unix seconds lower bound.
        Integer endTime = 56; // Integer | Unix seconds upper bound.
        try {
            ApiResponse<GetTrackingTagStats200Response> response = apiInstance.getTrackingTagStatsWithHttpInfo(accountId, tagId, aggregation, startTime, endTime);
            System.out.println("Status code: " + response.getStatusCode());
            System.out.println("Response headers: " + response.getHeaders());
            System.out.println("Response body: " + response.getData());
        } catch (ApiException e) {
            System.err.println("Exception when calling TrackingTagsApi#getTrackingTagStats");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Response headers: " + e.getResponseHeaders());
            System.err.println("Reason: " + e.getResponseBody());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
accountId String
tagId String Pixel id.
aggregation String Aggregation dimension. Defaults to `event`. [optional] [default to event] [enum: event, host, url, url_by_rule, pixel_fire, device_type, device_os, browser_type, had_pii, custom_data_field, match_keys, event_source, event_detection_method, event_processing_results, event_total_counts, event_value_count]
startTime Integer Unix seconds lower bound. [optional]
endTime Integer Unix seconds upper bound. [optional]

Return type

ApiResponse<GetTrackingTagStats200Response>

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Stats fetched -
400 Invalid query parameter. -
401 Unauthorized -
403 Ads access required (Ads add-on on legacy plans, included on usage-based plans), or the Meta token lacks ads permissions (reconnect required). -
404 Account or tracking tag not found. -
405 Platform does not support tracking-tag stats. -

listTrackingTagSharedAccounts

ListTrackingTagSharedAccounts200Response listTrackingTagSharedAccounts(accountId, tagId)

List accounts it is shared with

Meta only (platform `metaads`); other platforms return 405.

Example

// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.TrackingTagsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://zernio.com/api");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        TrackingTagsApi apiInstance = new TrackingTagsApi(defaultClient);
        String accountId = "accountId_example"; // String | 
        String tagId = "tagId_example"; // String | Pixel id.
        try {
            ListTrackingTagSharedAccounts200Response result = apiInstance.listTrackingTagSharedAccounts(accountId, tagId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrackingTagsApi#listTrackingTagSharedAccounts");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
accountId String
tagId String Pixel id.

Return type

ListTrackingTagSharedAccounts200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Shared ad accounts listed -
401 Unauthorized -
403 Ads access required (Ads add-on on legacy plans, included on usage-based plans), or the Meta token lacks ads permissions (reconnect required). -
404 Account or tracking tag not found. -
405 Platform does not support shared accounts. -

listTrackingTagSharedAccountsWithHttpInfo

ApiResponse listTrackingTagSharedAccounts listTrackingTagSharedAccountsWithHttpInfo(accountId, tagId)

List accounts it is shared with

Meta only (platform `metaads`); other platforms return 405.

Example

// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.TrackingTagsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://zernio.com/api");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        TrackingTagsApi apiInstance = new TrackingTagsApi(defaultClient);
        String accountId = "accountId_example"; // String | 
        String tagId = "tagId_example"; // String | Pixel id.
        try {
            ApiResponse<ListTrackingTagSharedAccounts200Response> response = apiInstance.listTrackingTagSharedAccountsWithHttpInfo(accountId, tagId);
            System.out.println("Status code: " + response.getStatusCode());
            System.out.println("Response headers: " + response.getHeaders());
            System.out.println("Response body: " + response.getData());
        } catch (ApiException e) {
            System.err.println("Exception when calling TrackingTagsApi#listTrackingTagSharedAccounts");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Response headers: " + e.getResponseHeaders());
            System.err.println("Reason: " + e.getResponseBody());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
accountId String
tagId String Pixel id.

Return type

ApiResponse<ListTrackingTagSharedAccounts200Response>

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Shared ad accounts listed -
401 Unauthorized -
403 Ads access required (Ads add-on on legacy plans, included on usage-based plans), or the Meta token lacks ads permissions (reconnect required). -
404 Account or tracking tag not found. -
405 Platform does not support shared accounts. -

listTrackingTags

ListTrackingTags200Response listTrackingTags(accountId, adAccountId)

List tracking tags

Returns the tracking tags (Meta Pixels) the connected ads account can see. Pass `?adAccountId=act_...` to scope the list to a single ad account; omit it to list every pixel reachable by the token (the name is then suffixed with the ad account it was discovered on, for disambiguation). The list view omits `code` — call `getTrackingTag` for the install snippet and full detail. Meta only today (platform `metaads`); other platforms return 405. The `accountId` must be the Meta ads SocialAccount created by the Ads add-on connect flow, not a Facebook/Instagram posting account. Get your `act_...` ids from `GET /v1/ads/accounts`.

Example

// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.TrackingTagsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://zernio.com/api");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        TrackingTagsApi apiInstance = new TrackingTagsApi(defaultClient);
        String accountId = "accountId_example"; // String | Meta ads SocialAccount id (platform `metaads`).
        String adAccountId = "adAccountId_example"; // String | Optional. Scope to one ad account, e.g. `act_123456789`.
        try {
            ListTrackingTags200Response result = apiInstance.listTrackingTags(accountId, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrackingTagsApi#listTrackingTags");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
accountId String Meta ads SocialAccount id (platform `metaads`).
adAccountId String Optional. Scope to one ad account, e.g. `act_123456789`. [optional]

Return type

ListTrackingTags200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Tracking tags listed -
400 Account platform not supported, or invalid `adAccountId`. -
401 Unauthorized -
403 Ads access required (Ads add-on on legacy plans, included on usage-based plans), or the Meta token lacks ads permissions (reconnect required). -
404 Account not found or not accessible. -
405 Platform does not support listing tracking tags. -

listTrackingTagsWithHttpInfo

ApiResponse listTrackingTags listTrackingTagsWithHttpInfo(accountId, adAccountId)

List tracking tags

Returns the tracking tags (Meta Pixels) the connected ads account can see. Pass `?adAccountId=act_...` to scope the list to a single ad account; omit it to list every pixel reachable by the token (the name is then suffixed with the ad account it was discovered on, for disambiguation). The list view omits `code` — call `getTrackingTag` for the install snippet and full detail. Meta only today (platform `metaads`); other platforms return 405. The `accountId` must be the Meta ads SocialAccount created by the Ads add-on connect flow, not a Facebook/Instagram posting account. Get your `act_...` ids from `GET /v1/ads/accounts`.

Example

// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.TrackingTagsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://zernio.com/api");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        TrackingTagsApi apiInstance = new TrackingTagsApi(defaultClient);
        String accountId = "accountId_example"; // String | Meta ads SocialAccount id (platform `metaads`).
        String adAccountId = "adAccountId_example"; // String | Optional. Scope to one ad account, e.g. `act_123456789`.
        try {
            ApiResponse<ListTrackingTags200Response> response = apiInstance.listTrackingTagsWithHttpInfo(accountId, adAccountId);
            System.out.println("Status code: " + response.getStatusCode());
            System.out.println("Response headers: " + response.getHeaders());
            System.out.println("Response body: " + response.getData());
        } catch (ApiException e) {
            System.err.println("Exception when calling TrackingTagsApi#listTrackingTags");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Response headers: " + e.getResponseHeaders());
            System.err.println("Reason: " + e.getResponseBody());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
accountId String Meta ads SocialAccount id (platform `metaads`).
adAccountId String Optional. Scope to one ad account, e.g. `act_123456789`. [optional]

Return type

ApiResponse<ListTrackingTags200Response>

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Tracking tags listed -
400 Account platform not supported, or invalid `adAccountId`. -
401 Unauthorized -
403 Ads access required (Ads add-on on legacy plans, included on usage-based plans), or the Meta token lacks ads permissions (reconnect required). -
404 Account not found or not accessible. -
405 Platform does not support listing tracking tags. -

removeTrackingTagSharedAccount

void removeTrackingTagSharedAccount(accountId, tagId, adAccountId)

Stop sharing with an account

`adAccountId` may be passed as a query parameter (recommended) or as a JSON body field for clients that can send DELETE bodies. Meta only (platform `metaads`); other platforms return 405.

Example

// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.TrackingTagsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://zernio.com/api");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        TrackingTagsApi apiInstance = new TrackingTagsApi(defaultClient);
        String accountId = "accountId_example"; // String | 
        String tagId = "tagId_example"; // String | Pixel id.
        String adAccountId = "adAccountId_example"; // String | Ad account to unshare, e.g. `act_123456789`. May also be sent in the JSON body.
        try {
            apiInstance.removeTrackingTagSharedAccount(accountId, tagId, adAccountId);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrackingTagsApi#removeTrackingTagSharedAccount");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
accountId String
tagId String Pixel id.
adAccountId String Ad account to unshare, e.g. `act_123456789`. May also be sent in the JSON body. [optional]

Return type

null (empty response body)

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 Ad account unshared (no content). -
400 `adAccountId` missing (neither query nor body), or Meta rejected the unshare. -
401 Unauthorized -
403 Ads access required (Ads add-on on legacy plans, included on usage-based plans), or the Meta token lacks ads permissions (reconnect required). -
404 Account or tracking tag not found. -
405 Platform does not support shared accounts. -

removeTrackingTagSharedAccountWithHttpInfo

ApiResponse removeTrackingTagSharedAccount removeTrackingTagSharedAccountWithHttpInfo(accountId, tagId, adAccountId)

Stop sharing with an account

`adAccountId` may be passed as a query parameter (recommended) or as a JSON body field for clients that can send DELETE bodies. Meta only (platform `metaads`); other platforms return 405.

Example

// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.TrackingTagsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://zernio.com/api");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        TrackingTagsApi apiInstance = new TrackingTagsApi(defaultClient);
        String accountId = "accountId_example"; // String | 
        String tagId = "tagId_example"; // String | Pixel id.
        String adAccountId = "adAccountId_example"; // String | Ad account to unshare, e.g. `act_123456789`. May also be sent in the JSON body.
        try {
            ApiResponse<Void> response = apiInstance.removeTrackingTagSharedAccountWithHttpInfo(accountId, tagId, adAccountId);
            System.out.println("Status code: " + response.getStatusCode());
            System.out.println("Response headers: " + response.getHeaders());
        } catch (ApiException e) {
            System.err.println("Exception when calling TrackingTagsApi#removeTrackingTagSharedAccount");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Response headers: " + e.getResponseHeaders());
            System.err.println("Reason: " + e.getResponseBody());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
accountId String
tagId String Pixel id.
adAccountId String Ad account to unshare, e.g. `act_123456789`. May also be sent in the JSON body. [optional]

Return type

ApiResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 Ad account unshared (no content). -
400 `adAccountId` missing (neither query nor body), or Meta rejected the unshare. -
401 Unauthorized -
403 Ads access required (Ads add-on on legacy plans, included on usage-based plans), or the Meta token lacks ads permissions (reconnect required). -
404 Account or tracking tag not found. -
405 Platform does not support shared accounts. -

updateTrackingTag

CreateTrackingTag201Response updateTrackingTag(accountId, tagId, updateTrackingTagRequest)

Update a tracking tag

Partial-update a pixel. Whitelisted fields: `name` (rename), `enableAutomaticMatching`, `automaticMatchingFields`, `firstPartyCookieStatus`, `dataUseSetting`. At least one is required. Returns the re-fetched canonical tag. Meta only (platform `metaads`); other platforms return 405. There is no DELETE — Meta has no API to delete a pixel. To stop using one, unshare it from your ad accounts (`DELETE .../tracking-tags/{tagId}/shared-accounts`) or disable it in Events Manager.

Example

// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.TrackingTagsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://zernio.com/api");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        TrackingTagsApi apiInstance = new TrackingTagsApi(defaultClient);
        String accountId = "accountId_example"; // String | 
        String tagId = "tagId_example"; // String | Pixel id.
        UpdateTrackingTagRequest updateTrackingTagRequest = new UpdateTrackingTagRequest(); // UpdateTrackingTagRequest | 
        try {
            CreateTrackingTag201Response result = apiInstance.updateTrackingTag(accountId, tagId, updateTrackingTagRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TrackingTagsApi#updateTrackingTag");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
accountId String
tagId String Pixel id.
updateTrackingTagRequest UpdateTrackingTagRequest

Return type

CreateTrackingTag201Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Tracking tag updated (re-fetched canonical state) -
400 Invalid body (e.g. no fields supplied) or Meta validation failure. -
401 Unauthorized -
403 Ads access required (Ads add-on on legacy plans, included on usage-based plans), or the Meta token lacks ads permissions (reconnect required). -
404 Account or tracking tag not found. -
405 Platform does not support updating tracking tags. -

updateTrackingTagWithHttpInfo

ApiResponse updateTrackingTag updateTrackingTagWithHttpInfo(accountId, tagId, updateTrackingTagRequest)

Update a tracking tag

Partial-update a pixel. Whitelisted fields: `name` (rename), `enableAutomaticMatching`, `automaticMatchingFields`, `firstPartyCookieStatus`, `dataUseSetting`. At least one is required. Returns the re-fetched canonical tag. Meta only (platform `metaads`); other platforms return 405. There is no DELETE — Meta has no API to delete a pixel. To stop using one, unshare it from your ad accounts (`DELETE .../tracking-tags/{tagId}/shared-accounts`) or disable it in Events Manager.

Example

// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.TrackingTagsApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://zernio.com/api");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        TrackingTagsApi apiInstance = new TrackingTagsApi(defaultClient);
        String accountId = "accountId_example"; // String | 
        String tagId = "tagId_example"; // String | Pixel id.
        UpdateTrackingTagRequest updateTrackingTagRequest = new UpdateTrackingTagRequest(); // UpdateTrackingTagRequest | 
        try {
            ApiResponse<CreateTrackingTag201Response> response = apiInstance.updateTrackingTagWithHttpInfo(accountId, tagId, updateTrackingTagRequest);
            System.out.println("Status code: " + response.getStatusCode());
            System.out.println("Response headers: " + response.getHeaders());
            System.out.println("Response body: " + response.getData());
        } catch (ApiException e) {
            System.err.println("Exception when calling TrackingTagsApi#updateTrackingTag");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Response headers: " + e.getResponseHeaders());
            System.err.println("Reason: " + e.getResponseBody());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
accountId String
tagId String Pixel id.
updateTrackingTagRequest UpdateTrackingTagRequest

Return type

ApiResponse<CreateTrackingTag201Response>

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Tracking tag updated (re-fetched canonical state) -
400 Invalid body (e.g. no fields supplied) or Meta validation failure. -
401 Unauthorized -
403 Ads access required (Ads add-on on legacy plans, included on usage-based plans), or the Meta token lacks ads permissions (reconnect required). -
404 Account or tracking tag not found. -
405 Platform does not support updating tracking tags. -