All URIs are relative to https://zernio.com/api
| Method | HTTP request | Description |
|---|---|---|
| add_tracking_tag_shared_account | POST /v1/accounts/{accountId}/tracking-tags/{tagId}/shared-accounts | Share with an ad account |
| create_tracking_tag | POST /v1/accounts/{accountId}/tracking-tags | Create a tracking tag |
| get_tracking_tag | GET /v1/accounts/{accountId}/tracking-tags/{tagId} | Get a tracking tag |
| get_tracking_tag_stats | GET /v1/accounts/{accountId}/tracking-tags/{tagId}/stats | Get aggregated event stats |
| list_tracking_tag_shared_accounts | GET /v1/accounts/{accountId}/tracking-tags/{tagId}/shared-accounts | List accounts it is shared with |
| list_tracking_tags | GET /v1/accounts/{accountId}/tracking-tags | List tracking tags |
| remove_tracking_tag_shared_account | DELETE /v1/accounts/{accountId}/tracking-tags/{tagId}/shared-accounts | Stop sharing with an account |
| update_tracking_tag | PATCH /v1/accounts/{accountId}/tracking-tags/{tagId} | Update a tracking tag |
add_tracking_tag_shared_account(account_id, tag_id, add_tracking_tag_shared_account_request)
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.
require 'time'
require 'zernio-sdk'
# setup authorization
Zernio.configure do |config|
# Configure Bearer authorization (JWT): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Zernio::TrackingTagsApi.new
account_id = 'account_id_example' # String |
tag_id = 'tag_id_example' # String | Pixel id.
add_tracking_tag_shared_account_request = Zernio::AddTrackingTagSharedAccountRequest.new({ad_account_id: 'ad_account_id_example'}) # AddTrackingTagSharedAccountRequest |
begin
# Share with an ad account
result = api_instance.add_tracking_tag_shared_account(account_id, tag_id, add_tracking_tag_shared_account_request)
p result
rescue Zernio::ApiError => e
puts "Error when calling TrackingTagsApi->add_tracking_tag_shared_account: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> add_tracking_tag_shared_account_with_http_info(account_id, tag_id, add_tracking_tag_shared_account_request)
begin
# Share with an ad account
data, status_code, headers = api_instance.add_tracking_tag_shared_account_with_http_info(account_id, tag_id, add_tracking_tag_shared_account_request)
p status_code # => 2xx
p headers # => { ... }
p data # => <AddTrackingTagSharedAccount201Response>
rescue Zernio::ApiError => e
puts "Error when calling TrackingTagsApi->add_tracking_tag_shared_account_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| account_id | String | ||
| tag_id | String | Pixel id. | |
| add_tracking_tag_shared_account_request | AddTrackingTagSharedAccountRequest |
AddTrackingTagSharedAccount201Response
- Content-Type: application/json
- Accept: application/json
create_tracking_tag(account_id, create_tracking_tag_request)
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.
require 'time'
require 'zernio-sdk'
# setup authorization
Zernio.configure do |config|
# Configure Bearer authorization (JWT): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Zernio::TrackingTagsApi.new
account_id = 'account_id_example' # String | Meta ads SocialAccount id (platform `metaads`).
create_tracking_tag_request = Zernio::CreateTrackingTagRequest.new({ad_account_id: 'ad_account_id_example', name: 'name_example'}) # CreateTrackingTagRequest |
begin
# Create a tracking tag
result = api_instance.create_tracking_tag(account_id, create_tracking_tag_request)
p result
rescue Zernio::ApiError => e
puts "Error when calling TrackingTagsApi->create_tracking_tag: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> create_tracking_tag_with_http_info(account_id, create_tracking_tag_request)
begin
# Create a tracking tag
data, status_code, headers = api_instance.create_tracking_tag_with_http_info(account_id, create_tracking_tag_request)
p status_code # => 2xx
p headers # => { ... }
p data # => <CreateTrackingTag201Response>
rescue Zernio::ApiError => e
puts "Error when calling TrackingTagsApi->create_tracking_tag_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| account_id | String | Meta ads SocialAccount id (platform `metaads`). | |
| create_tracking_tag_request | CreateTrackingTagRequest |
- Content-Type: application/json
- Accept: application/json
get_tracking_tag(account_id, tag_id)
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.
require 'time'
require 'zernio-sdk'
# setup authorization
Zernio.configure do |config|
# Configure Bearer authorization (JWT): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Zernio::TrackingTagsApi.new
account_id = 'account_id_example' # String |
tag_id = 'tag_id_example' # String | Pixel id.
begin
# Get a tracking tag
result = api_instance.get_tracking_tag(account_id, tag_id)
p result
rescue Zernio::ApiError => e
puts "Error when calling TrackingTagsApi->get_tracking_tag: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_tracking_tag_with_http_info(account_id, tag_id)
begin
# Get a tracking tag
data, status_code, headers = api_instance.get_tracking_tag_with_http_info(account_id, tag_id)
p status_code # => 2xx
p headers # => { ... }
p data # => <CreateTrackingTag201Response>
rescue Zernio::ApiError => e
puts "Error when calling TrackingTagsApi->get_tracking_tag_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| account_id | String | ||
| tag_id | String | Pixel id. |
- Content-Type: Not defined
- Accept: application/json
get_tracking_tag_stats(account_id, tag_id, opts)
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.
require 'time'
require 'zernio-sdk'
# setup authorization
Zernio.configure do |config|
# Configure Bearer authorization (JWT): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Zernio::TrackingTagsApi.new
account_id = 'account_id_example' # String |
tag_id = 'tag_id_example' # String | Pixel id.
opts = {
aggregation: 'event', # String | Aggregation dimension. Defaults to `event`.
start_time: 56, # Integer | Unix seconds lower bound.
end_time: 56 # Integer | Unix seconds upper bound.
}
begin
# Get aggregated event stats
result = api_instance.get_tracking_tag_stats(account_id, tag_id, opts)
p result
rescue Zernio::ApiError => e
puts "Error when calling TrackingTagsApi->get_tracking_tag_stats: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_tracking_tag_stats_with_http_info(account_id, tag_id, opts)
begin
# Get aggregated event stats
data, status_code, headers = api_instance.get_tracking_tag_stats_with_http_info(account_id, tag_id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <GetTrackingTagStats200Response>
rescue Zernio::ApiError => e
puts "Error when calling TrackingTagsApi->get_tracking_tag_stats_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| account_id | String | ||
| tag_id | String | Pixel id. | |
| aggregation | String | Aggregation dimension. Defaults to `event`. | [optional][default to 'event'] |
| start_time | Integer | Unix seconds lower bound. | [optional] |
| end_time | Integer | Unix seconds upper bound. | [optional] |
GetTrackingTagStats200Response
- Content-Type: Not defined
- Accept: application/json
list_tracking_tag_shared_accounts(account_id, tag_id)
List accounts it is shared with
Meta only (platform metaads); other platforms return 405.
require 'time'
require 'zernio-sdk'
# setup authorization
Zernio.configure do |config|
# Configure Bearer authorization (JWT): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Zernio::TrackingTagsApi.new
account_id = 'account_id_example' # String |
tag_id = 'tag_id_example' # String | Pixel id.
begin
# List accounts it is shared with
result = api_instance.list_tracking_tag_shared_accounts(account_id, tag_id)
p result
rescue Zernio::ApiError => e
puts "Error when calling TrackingTagsApi->list_tracking_tag_shared_accounts: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> list_tracking_tag_shared_accounts_with_http_info(account_id, tag_id)
begin
# List accounts it is shared with
data, status_code, headers = api_instance.list_tracking_tag_shared_accounts_with_http_info(account_id, tag_id)
p status_code # => 2xx
p headers # => { ... }
p data # => <ListTrackingTagSharedAccounts200Response>
rescue Zernio::ApiError => e
puts "Error when calling TrackingTagsApi->list_tracking_tag_shared_accounts_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| account_id | String | ||
| tag_id | String | Pixel id. |
ListTrackingTagSharedAccounts200Response
- Content-Type: Not defined
- Accept: application/json
list_tracking_tags(account_id, opts)
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.
require 'time'
require 'zernio-sdk'
# setup authorization
Zernio.configure do |config|
# Configure Bearer authorization (JWT): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Zernio::TrackingTagsApi.new
account_id = 'account_id_example' # String | Meta ads SocialAccount id (platform `metaads`).
opts = {
ad_account_id: 'ad_account_id_example' # String | Optional. Scope to one ad account, e.g. `act_123456789`.
}
begin
# List tracking tags
result = api_instance.list_tracking_tags(account_id, opts)
p result
rescue Zernio::ApiError => e
puts "Error when calling TrackingTagsApi->list_tracking_tags: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> list_tracking_tags_with_http_info(account_id, opts)
begin
# List tracking tags
data, status_code, headers = api_instance.list_tracking_tags_with_http_info(account_id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <ListTrackingTags200Response>
rescue Zernio::ApiError => e
puts "Error when calling TrackingTagsApi->list_tracking_tags_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| account_id | String | Meta ads SocialAccount id (platform `metaads`). | |
| ad_account_id | String | Optional. Scope to one ad account, e.g. `act_123456789`. | [optional] |
- Content-Type: Not defined
- Accept: application/json
remove_tracking_tag_shared_account(account_id, tag_id, opts)
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.
require 'time'
require 'zernio-sdk'
# setup authorization
Zernio.configure do |config|
# Configure Bearer authorization (JWT): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Zernio::TrackingTagsApi.new
account_id = 'account_id_example' # String |
tag_id = 'tag_id_example' # String | Pixel id.
opts = {
ad_account_id: 'ad_account_id_example' # String | Ad account to unshare, e.g. `act_123456789`. May also be sent in the JSON body.
}
begin
# Stop sharing with an account
api_instance.remove_tracking_tag_shared_account(account_id, tag_id, opts)
rescue Zernio::ApiError => e
puts "Error when calling TrackingTagsApi->remove_tracking_tag_shared_account: #{e}"
endThis returns an Array which contains the response data (nil in this case), status code and headers.
<Array(nil, Integer, Hash)> remove_tracking_tag_shared_account_with_http_info(account_id, tag_id, opts)
begin
# Stop sharing with an account
data, status_code, headers = api_instance.remove_tracking_tag_shared_account_with_http_info(account_id, tag_id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => nil
rescue Zernio::ApiError => e
puts "Error when calling TrackingTagsApi->remove_tracking_tag_shared_account_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| account_id | String | ||
| tag_id | String | Pixel id. | |
| ad_account_id | String | Ad account to unshare, e.g. `act_123456789`. May also be sent in the JSON body. | [optional] |
nil (empty response body)
- Content-Type: Not defined
- Accept: application/json
update_tracking_tag(account_id, tag_id, update_tracking_tag_request)
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.
require 'time'
require 'zernio-sdk'
# setup authorization
Zernio.configure do |config|
# Configure Bearer authorization (JWT): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Zernio::TrackingTagsApi.new
account_id = 'account_id_example' # String |
tag_id = 'tag_id_example' # String | Pixel id.
update_tracking_tag_request = Zernio::UpdateTrackingTagRequest.new # UpdateTrackingTagRequest |
begin
# Update a tracking tag
result = api_instance.update_tracking_tag(account_id, tag_id, update_tracking_tag_request)
p result
rescue Zernio::ApiError => e
puts "Error when calling TrackingTagsApi->update_tracking_tag: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> update_tracking_tag_with_http_info(account_id, tag_id, update_tracking_tag_request)
begin
# Update a tracking tag
data, status_code, headers = api_instance.update_tracking_tag_with_http_info(account_id, tag_id, update_tracking_tag_request)
p status_code # => 2xx
p headers # => { ... }
p data # => <CreateTrackingTag201Response>
rescue Zernio::ApiError => e
puts "Error when calling TrackingTagsApi->update_tracking_tag_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| account_id | String | ||
| tag_id | String | Pixel id. | |
| update_tracking_tag_request | UpdateTrackingTagRequest |
- Content-Type: application/json
- Accept: application/json