zernio-sdk 0.0.550 → 0.0.552

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +73 -75
  3. data/docs/AdAccountsApi.md +915 -0
  4. data/docs/AdCampaignsApi.md +615 -15
  5. data/docs/AdCreativesApi.md +815 -0
  6. data/docs/AdInsightsApi.md +415 -0
  7. data/docs/AdTargetingApi.md +371 -0
  8. data/docs/AnalyticsApi.md +7 -7
  9. data/docs/BoostPostRequestTracking.md +1 -1
  10. data/docs/{CreateLeadFormRequestQuestionsInnerOptionsInner.md → BoostPostRequestTrackingUrlTagsInner.md} +2 -2
  11. data/docs/ConversionsApi.md +890 -0
  12. data/docs/CreateLeadFormRequestQuestionsInner.md +1 -1
  13. data/docs/LeadGenApi.md +527 -0
  14. data/docs/MessagingAdsApi.md +215 -0
  15. data/docs/ReachAndFrequencyApi.md +294 -0
  16. data/docs/TrackingTagsApi.md +141 -0
  17. data/docs/YouTubeDailyViewsResponse.md +2 -0
  18. data/docs/YouTubeDemographicsResponse.md +2 -0
  19. data/docs/YouTubeVideoRetentionResponse.md +2 -0
  20. data/lib/zernio-sdk/api/ad_accounts_api.rb +958 -0
  21. data/lib/zernio-sdk/api/ad_campaigns_api.rb +618 -12
  22. data/lib/zernio-sdk/api/ad_creatives_api.rb +826 -0
  23. data/lib/zernio-sdk/api/ad_insights_api.rb +446 -0
  24. data/lib/zernio-sdk/api/ad_targeting_api.rb +404 -0
  25. data/lib/zernio-sdk/api/analytics_api.rb +8 -8
  26. data/lib/zernio-sdk/api/conversions_api.rb +936 -0
  27. data/lib/zernio-sdk/api/lead_gen_api.rb +547 -0
  28. data/lib/zernio-sdk/api/messaging_ads_api.rb +226 -0
  29. data/lib/zernio-sdk/api/reach_and_frequency_api.rb +316 -0
  30. data/lib/zernio-sdk/api/tracking_tags_api.rb +137 -0
  31. data/lib/zernio-sdk/models/boost_post_request_tracking.rb +5 -2
  32. data/lib/zernio-sdk/models/{create_lead_form_request_questions_inner_options_inner.rb → boost_post_request_tracking_url_tags_inner.rb} +3 -3
  33. data/lib/zernio-sdk/models/create_lead_form_request_questions_inner.rb +1 -1
  34. data/lib/zernio-sdk/models/you_tube_daily_views_response.rb +11 -1
  35. data/lib/zernio-sdk/models/you_tube_demographics_response.rb +11 -1
  36. data/lib/zernio-sdk/models/you_tube_video_retention_response.rb +11 -1
  37. data/lib/zernio-sdk/version.rb +1 -1
  38. data/lib/zernio-sdk.rb +9 -2
  39. data/openapi.yaml +329 -163
  40. data/spec/api/ad_accounts_api_spec.rb +206 -0
  41. data/spec/api/ad_campaigns_api_spec.rb +119 -6
  42. data/spec/api/ad_creatives_api_spec.rb +182 -0
  43. data/spec/api/ad_insights_api_spec.rb +120 -0
  44. data/spec/api/ad_targeting_api_spec.rb +101 -0
  45. data/spec/api/analytics_api_spec.rb +4 -4
  46. data/spec/api/conversions_api_spec.rb +199 -0
  47. data/spec/api/lead_gen_api_spec.rb +131 -0
  48. data/spec/api/messaging_ads_api_spec.rb +71 -0
  49. data/spec/api/reach_and_frequency_api_spec.rb +87 -0
  50. data/spec/api/tracking_tags_api_spec.rb +25 -0
  51. data/spec/models/{create_lead_form_request_questions_inner_options_inner_spec.rb → boost_post_request_tracking_url_tags_inner_spec.rb} +6 -6
  52. data/spec/models/you_tube_daily_views_response_spec.rb +6 -0
  53. data/spec/models/you_tube_demographics_response_spec.rb +6 -0
  54. data/spec/models/you_tube_video_retention_response_spec.rb +6 -0
  55. metadata +38 -10
  56. data/docs/AdsApi.md +0 -5278
  57. data/lib/zernio-sdk/api/ads_api.rb +0 -5391
  58. data/spec/api/ads_api_spec.rb +0 -1015
@@ -0,0 +1,890 @@
1
+ # Zernio::ConversionsApi
2
+
3
+ All URIs are relative to *https://zernio.com/api*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**add_conversion_associations**](ConversionsApi.md#add_conversion_associations) | **POST** /v1/accounts/{accountId}/conversion-destinations/{destinationId}/associations | Associate campaigns |
8
+ | [**adjust_conversions**](ConversionsApi.md#adjust_conversions) | **POST** /v1/ads/conversions/adjustments | Adjust uploaded conversions |
9
+ | [**create_conversion_destination**](ConversionsApi.md#create_conversion_destination) | **POST** /v1/accounts/{accountId}/conversion-destinations | Create a conversion destination |
10
+ | [**delete_conversion_destination**](ConversionsApi.md#delete_conversion_destination) | **DELETE** /v1/accounts/{accountId}/conversion-destinations/{destinationId} | Delete a conversion destination |
11
+ | [**get_conversion_destination**](ConversionsApi.md#get_conversion_destination) | **GET** /v1/accounts/{accountId}/conversion-destinations/{destinationId} | Get a conversion destination |
12
+ | [**get_conversion_metrics**](ConversionsApi.md#get_conversion_metrics) | **GET** /v1/accounts/{accountId}/conversion-destinations/{destinationId}/metrics | Get attribution metrics |
13
+ | [**get_conversions_quality**](ConversionsApi.md#get_conversions_quality) | **GET** /v1/ads/conversions/quality | Get Event Match Quality |
14
+ | [**list_conversion_associations**](ConversionsApi.md#list_conversion_associations) | **GET** /v1/accounts/{accountId}/conversion-destinations/{destinationId}/associations | List associated campaigns |
15
+ | [**list_conversion_destinations**](ConversionsApi.md#list_conversion_destinations) | **GET** /v1/accounts/{accountId}/conversion-destinations | List conversion destinations |
16
+ | [**remove_conversion_associations**](ConversionsApi.md#remove_conversion_associations) | **DELETE** /v1/accounts/{accountId}/conversion-destinations/{destinationId}/associations | Remove associated campaigns |
17
+ | [**send_conversions**](ConversionsApi.md#send_conversions) | **POST** /v1/ads/conversions | Send conversion events |
18
+ | [**update_conversion_destination**](ConversionsApi.md#update_conversion_destination) | **PATCH** /v1/accounts/{accountId}/conversion-destinations/{destinationId} | Update a conversion destination |
19
+
20
+
21
+ ## add_conversion_associations
22
+
23
+ > <AddConversionAssociations200Response> add_conversion_associations(account_id, destination_id, add_conversion_associations_request)
24
+
25
+ Associate campaigns
26
+
27
+ Associate one or more campaigns with this conversion rule. Returns a per-campaign success/failure result so callers can retry only the rows that failed (e.g. wrong campaign type for the rule's objective).
28
+
29
+ ### Examples
30
+
31
+ ```ruby
32
+ require 'time'
33
+ require 'zernio-sdk'
34
+ # setup authorization
35
+ Zernio.configure do |config|
36
+ # Configure Bearer authorization (JWT): bearerAuth
37
+ config.access_token = 'YOUR_BEARER_TOKEN'
38
+ end
39
+
40
+ api_instance = Zernio::ConversionsApi.new
41
+ account_id = 'account_id_example' # String |
42
+ destination_id = 'destination_id_example' # String |
43
+ add_conversion_associations_request = Zernio::AddConversionAssociationsRequest.new({ad_account_id: 'ad_account_id_example', campaign_ids: ['campaign_ids_example']}) # AddConversionAssociationsRequest |
44
+
45
+ begin
46
+ # Associate campaigns
47
+ result = api_instance.add_conversion_associations(account_id, destination_id, add_conversion_associations_request)
48
+ p result
49
+ rescue Zernio::ApiError => e
50
+ puts "Error when calling ConversionsApi->add_conversion_associations: #{e}"
51
+ end
52
+ ```
53
+
54
+ #### Using the add_conversion_associations_with_http_info variant
55
+
56
+ This returns an Array which contains the response data, status code and headers.
57
+
58
+ > <Array(<AddConversionAssociations200Response>, Integer, Hash)> add_conversion_associations_with_http_info(account_id, destination_id, add_conversion_associations_request)
59
+
60
+ ```ruby
61
+ begin
62
+ # Associate campaigns
63
+ data, status_code, headers = api_instance.add_conversion_associations_with_http_info(account_id, destination_id, add_conversion_associations_request)
64
+ p status_code # => 2xx
65
+ p headers # => { ... }
66
+ p data # => <AddConversionAssociations200Response>
67
+ rescue Zernio::ApiError => e
68
+ puts "Error when calling ConversionsApi->add_conversion_associations_with_http_info: #{e}"
69
+ end
70
+ ```
71
+
72
+ ### Parameters
73
+
74
+ | Name | Type | Description | Notes |
75
+ | ---- | ---- | ----------- | ----- |
76
+ | **account_id** | **String** | | |
77
+ | **destination_id** | **String** | | |
78
+ | **add_conversion_associations_request** | [**AddConversionAssociationsRequest**](AddConversionAssociationsRequest.md) | | |
79
+
80
+ ### Return type
81
+
82
+ [**AddConversionAssociations200Response**](AddConversionAssociations200Response.md)
83
+
84
+ ### Authorization
85
+
86
+ [bearerAuth](../README.md#bearerAuth)
87
+
88
+ ### HTTP request headers
89
+
90
+ - **Content-Type**: application/json
91
+ - **Accept**: application/json
92
+
93
+
94
+ ## adjust_conversions
95
+
96
+ > <AdjustConversions200Response> adjust_conversions(adjust_conversions_request)
97
+
98
+ Adjust uploaded conversions
99
+
100
+ Adjust conversions that were previously uploaded via `POST /v1/ads/conversions` — retract them, restate their value, or enhance them with first-party data. Requires the Ads add-on. **Google Ads only.** Google handles adjustments through the classic Google Ads API (`ConversionAdjustmentUploadService`); the Data Manager `ingestEvents` path used for sending conversions is ingest-only. Meta and LinkedIn have no equivalent, so this endpoint returns `405` for those platforms. Adjustment types: - `RETRACTION` — remove the conversion entirely (refund, chargeback, cancelled order, churn). - `RESTATEMENT` — change the conversion's value (upgrade / downgrade / partial refund). Send the corrected **total** value in `restatementValue` (not a delta). - `ENHANCEMENT` — attach first-party identifiers (hashed email / phone) to an existing conversion (enhanced conversions applied after the fact). Identifying the original conversion (per adjustment): - `orderId` — the transaction ID you sent as `eventId` on the original conversion. Recommended, and **required** for `ENHANCEMENT`. - or `gclid` + `conversionTime` — the click ID and the original conversion's time (unix seconds). Not available for `ENHANCEMENT`. `destinationId` is the conversion action resource name, e.g. `customers/1234567890/conversionActions/987654321` (same value you send to `POST /v1/ads/conversions`). PII in `user` is hashed with SHA-256 server-side (Gmail-specific normalization included). Send plaintext. Times are unix seconds; we convert to Google's required `yyyy-MM-dd HH:mm:ss+00:00` format. Up to 2000 adjustments per request; partial failure is supported (inspect `adjustmentsFailed` / `failures[]`).
101
+
102
+ ### Examples
103
+
104
+ ```ruby
105
+ require 'time'
106
+ require 'zernio-sdk'
107
+ # setup authorization
108
+ Zernio.configure do |config|
109
+ # Configure Bearer authorization (JWT): bearerAuth
110
+ config.access_token = 'YOUR_BEARER_TOKEN'
111
+ end
112
+
113
+ api_instance = Zernio::ConversionsApi.new
114
+ adjust_conversions_request = Zernio::AdjustConversionsRequest.new({account_id: 'account_id_example', destination_id: 'destination_id_example', adjustments: [Zernio::AdjustConversionsRequestAdjustmentsInner.new({adjustment_type: 'RETRACTION', adjustment_time: 3.56})]}) # AdjustConversionsRequest |
115
+
116
+ begin
117
+ # Adjust uploaded conversions
118
+ result = api_instance.adjust_conversions(adjust_conversions_request)
119
+ p result
120
+ rescue Zernio::ApiError => e
121
+ puts "Error when calling ConversionsApi->adjust_conversions: #{e}"
122
+ end
123
+ ```
124
+
125
+ #### Using the adjust_conversions_with_http_info variant
126
+
127
+ This returns an Array which contains the response data, status code and headers.
128
+
129
+ > <Array(<AdjustConversions200Response>, Integer, Hash)> adjust_conversions_with_http_info(adjust_conversions_request)
130
+
131
+ ```ruby
132
+ begin
133
+ # Adjust uploaded conversions
134
+ data, status_code, headers = api_instance.adjust_conversions_with_http_info(adjust_conversions_request)
135
+ p status_code # => 2xx
136
+ p headers # => { ... }
137
+ p data # => <AdjustConversions200Response>
138
+ rescue Zernio::ApiError => e
139
+ puts "Error when calling ConversionsApi->adjust_conversions_with_http_info: #{e}"
140
+ end
141
+ ```
142
+
143
+ ### Parameters
144
+
145
+ | Name | Type | Description | Notes |
146
+ | ---- | ---- | ----------- | ----- |
147
+ | **adjust_conversions_request** | [**AdjustConversionsRequest**](AdjustConversionsRequest.md) | | |
148
+
149
+ ### Return type
150
+
151
+ [**AdjustConversions200Response**](AdjustConversions200Response.md)
152
+
153
+ ### Authorization
154
+
155
+ [bearerAuth](../README.md#bearerAuth)
156
+
157
+ ### HTTP request headers
158
+
159
+ - **Content-Type**: application/json
160
+ - **Accept**: application/json
161
+
162
+
163
+ ## create_conversion_destination
164
+
165
+ > <CreateConversionDestination201Response> create_conversion_destination(account_id, create_conversion_destination_request)
166
+
167
+ Create a conversion destination
168
+
169
+ Create a new conversion destination on the platform. Supported for LinkedIn (conversion rule) and Google Ads (conversion action). Meta manages destinations in its own UI and returns 405. **LinkedIn:** creation is NOT idempotent. A retry creates a second destination. Deduplicate before retrying. **Google Ads:** calling with a name that already exists reuses the existing conversion action transparently (the response is identical to a fresh create). Calling with the same name but a different category returns a typed `IDEMPOTENCY_CONFLICT` (409) rather than silently returning the mismatched action. **LinkedIn:** the rule is created with `conversionMethod=CONVERSIONS_API` and (by default) auto-associated with all of the ad account's campaigns via `autoAssociationType=ALL_CAMPAIGNS`. Pass `autoAssociationType: NONE` to opt out and manage associations explicitly via the associations endpoints below. 365-day attribution windows are only valid for `SUBMIT_APPLICATION`, `PURCHASE`, `ADD_TO_CART`, `QUALIFIED_LEAD`, and `LEAD` rule types; the API rejects other combinations locally. **Google Ads:** the conversion action is created with `type=UPLOAD_CLICKS` (required for API-uploaded offline conversions, immutable after creation). The `type` field carries the Google `ConversionActionCategory` enum value, e.g. `PURCHASE`, `SUBSCRIBE_PAID`, `SIGNUP`, `IMPORTED_LEAD`, `BOOK_APPOINTMENT`. Unified standard event names (e.g. `Purchase`, `Subscribe`, `CompleteRegistration`, `Lead`, `Schedule`) are resolved to their Google category equivalents automatically. The action defaults to secondary (non-primary) to avoid immediately steering Smart Bidding; pass `primaryForGoal: true` to opt in.
170
+
171
+ ### Examples
172
+
173
+ ```ruby
174
+ require 'time'
175
+ require 'zernio-sdk'
176
+ # setup authorization
177
+ Zernio.configure do |config|
178
+ # Configure Bearer authorization (JWT): bearerAuth
179
+ config.access_token = 'YOUR_BEARER_TOKEN'
180
+ end
181
+
182
+ api_instance = Zernio::ConversionsApi.new
183
+ account_id = 'account_id_example' # String | SocialAccount ID (linkedinads or googleads).
184
+ create_conversion_destination_request = Zernio::CreateConversionDestinationRequest.new({ad_account_id: 'ad_account_id_example', name: 'name_example', type: 'type_example'}) # CreateConversionDestinationRequest |
185
+
186
+ begin
187
+ # Create a conversion destination
188
+ result = api_instance.create_conversion_destination(account_id, create_conversion_destination_request)
189
+ p result
190
+ rescue Zernio::ApiError => e
191
+ puts "Error when calling ConversionsApi->create_conversion_destination: #{e}"
192
+ end
193
+ ```
194
+
195
+ #### Using the create_conversion_destination_with_http_info variant
196
+
197
+ This returns an Array which contains the response data, status code and headers.
198
+
199
+ > <Array(<CreateConversionDestination201Response>, Integer, Hash)> create_conversion_destination_with_http_info(account_id, create_conversion_destination_request)
200
+
201
+ ```ruby
202
+ begin
203
+ # Create a conversion destination
204
+ data, status_code, headers = api_instance.create_conversion_destination_with_http_info(account_id, create_conversion_destination_request)
205
+ p status_code # => 2xx
206
+ p headers # => { ... }
207
+ p data # => <CreateConversionDestination201Response>
208
+ rescue Zernio::ApiError => e
209
+ puts "Error when calling ConversionsApi->create_conversion_destination_with_http_info: #{e}"
210
+ end
211
+ ```
212
+
213
+ ### Parameters
214
+
215
+ | Name | Type | Description | Notes |
216
+ | ---- | ---- | ----------- | ----- |
217
+ | **account_id** | **String** | SocialAccount ID (linkedinads or googleads). | |
218
+ | **create_conversion_destination_request** | [**CreateConversionDestinationRequest**](CreateConversionDestinationRequest.md) | | |
219
+
220
+ ### Return type
221
+
222
+ [**CreateConversionDestination201Response**](CreateConversionDestination201Response.md)
223
+
224
+ ### Authorization
225
+
226
+ [bearerAuth](../README.md#bearerAuth)
227
+
228
+ ### HTTP request headers
229
+
230
+ - **Content-Type**: application/json
231
+ - **Accept**: application/json
232
+
233
+
234
+ ## delete_conversion_destination
235
+
236
+ > delete_conversion_destination(account_id, destination_id, opts)
237
+
238
+ Delete a conversion destination
239
+
240
+ LinkedIn-only today. LinkedIn does not expose hard-delete on conversion rules — what their UI calls \"delete\" is the same `enabled: false` flip we apply here. The rule remains fetchable via GET with `status: 'inactive'`; the unified discovery endpoint hides it by default. `adAccountId` may be passed as a query parameter (recommended) or as a JSON body field for clients that can send DELETE bodies.
241
+
242
+ ### Examples
243
+
244
+ ```ruby
245
+ require 'time'
246
+ require 'zernio-sdk'
247
+ # setup authorization
248
+ Zernio.configure do |config|
249
+ # Configure Bearer authorization (JWT): bearerAuth
250
+ config.access_token = 'YOUR_BEARER_TOKEN'
251
+ end
252
+
253
+ api_instance = Zernio::ConversionsApi.new
254
+ account_id = 'account_id_example' # String |
255
+ destination_id = 'destination_id_example' # String |
256
+ opts = {
257
+ ad_account_id: 'ad_account_id_example' # String | Required as query OR in JSON body.
258
+ }
259
+
260
+ begin
261
+ # Delete a conversion destination
262
+ api_instance.delete_conversion_destination(account_id, destination_id, opts)
263
+ rescue Zernio::ApiError => e
264
+ puts "Error when calling ConversionsApi->delete_conversion_destination: #{e}"
265
+ end
266
+ ```
267
+
268
+ #### Using the delete_conversion_destination_with_http_info variant
269
+
270
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
271
+
272
+ > <Array(nil, Integer, Hash)> delete_conversion_destination_with_http_info(account_id, destination_id, opts)
273
+
274
+ ```ruby
275
+ begin
276
+ # Delete a conversion destination
277
+ data, status_code, headers = api_instance.delete_conversion_destination_with_http_info(account_id, destination_id, opts)
278
+ p status_code # => 2xx
279
+ p headers # => { ... }
280
+ p data # => nil
281
+ rescue Zernio::ApiError => e
282
+ puts "Error when calling ConversionsApi->delete_conversion_destination_with_http_info: #{e}"
283
+ end
284
+ ```
285
+
286
+ ### Parameters
287
+
288
+ | Name | Type | Description | Notes |
289
+ | ---- | ---- | ----------- | ----- |
290
+ | **account_id** | **String** | | |
291
+ | **destination_id** | **String** | | |
292
+ | **ad_account_id** | **String** | Required as query OR in JSON body. | [optional] |
293
+
294
+ ### Return type
295
+
296
+ nil (empty response body)
297
+
298
+ ### Authorization
299
+
300
+ [bearerAuth](../README.md#bearerAuth)
301
+
302
+ ### HTTP request headers
303
+
304
+ - **Content-Type**: Not defined
305
+ - **Accept**: application/json
306
+
307
+
308
+ ## get_conversion_destination
309
+
310
+ > <GetConversionDestination200Response> get_conversion_destination(account_id, destination_id, ad_account_id)
311
+
312
+ Get a conversion destination
313
+
314
+ LinkedIn-only today. Returns the full destination record for one conversion rule. The `adAccountId` query parameter is required because LinkedIn rules are scoped to a sponsored ad account.
315
+
316
+ ### Examples
317
+
318
+ ```ruby
319
+ require 'time'
320
+ require 'zernio-sdk'
321
+ # setup authorization
322
+ Zernio.configure do |config|
323
+ # Configure Bearer authorization (JWT): bearerAuth
324
+ config.access_token = 'YOUR_BEARER_TOKEN'
325
+ end
326
+
327
+ api_instance = Zernio::ConversionsApi.new
328
+ account_id = 'account_id_example' # String |
329
+ destination_id = 'destination_id_example' # String |
330
+ ad_account_id = 'ad_account_id_example' # String | Numeric ID or full `urn:li:sponsoredAccount:{id}` URN.
331
+
332
+ begin
333
+ # Get a conversion destination
334
+ result = api_instance.get_conversion_destination(account_id, destination_id, ad_account_id)
335
+ p result
336
+ rescue Zernio::ApiError => e
337
+ puts "Error when calling ConversionsApi->get_conversion_destination: #{e}"
338
+ end
339
+ ```
340
+
341
+ #### Using the get_conversion_destination_with_http_info variant
342
+
343
+ This returns an Array which contains the response data, status code and headers.
344
+
345
+ > <Array(<GetConversionDestination200Response>, Integer, Hash)> get_conversion_destination_with_http_info(account_id, destination_id, ad_account_id)
346
+
347
+ ```ruby
348
+ begin
349
+ # Get a conversion destination
350
+ data, status_code, headers = api_instance.get_conversion_destination_with_http_info(account_id, destination_id, ad_account_id)
351
+ p status_code # => 2xx
352
+ p headers # => { ... }
353
+ p data # => <GetConversionDestination200Response>
354
+ rescue Zernio::ApiError => e
355
+ puts "Error when calling ConversionsApi->get_conversion_destination_with_http_info: #{e}"
356
+ end
357
+ ```
358
+
359
+ ### Parameters
360
+
361
+ | Name | Type | Description | Notes |
362
+ | ---- | ---- | ----------- | ----- |
363
+ | **account_id** | **String** | | |
364
+ | **destination_id** | **String** | | |
365
+ | **ad_account_id** | **String** | Numeric ID or full &#x60;urn:li:sponsoredAccount:{id}&#x60; URN. | |
366
+
367
+ ### Return type
368
+
369
+ [**GetConversionDestination200Response**](GetConversionDestination200Response.md)
370
+
371
+ ### Authorization
372
+
373
+ [bearerAuth](../README.md#bearerAuth)
374
+
375
+ ### HTTP request headers
376
+
377
+ - **Content-Type**: Not defined
378
+ - **Accept**: application/json
379
+
380
+
381
+ ## get_conversion_metrics
382
+
383
+ > <GetConversionMetrics200Response> get_conversion_metrics(account_id, destination_id, ad_account_id, start_date, opts)
384
+
385
+ Get attribution metrics
386
+
387
+ LinkedIn-only today. Returns conversion-attribution metrics (`externalWebsiteConversions`, `externalWebsitePostClickConversions`, `externalWebsitePostViewConversions`, `conversionValueInLocalCurrency`, `qualifiedLeads`, `costInLocalCurrency`) bucketed by date. Date-range constraints (passed through from LinkedIn): - `granularity=DAILY` is retained for ~6 months only - `granularity=ALL` with a range > 6 months auto-rounds to month boundaries - `granularity=MONTHLY`/`YEARLY` retains 24 months Throttle: LinkedIn caps adAnalytics at 45M metric values per 5-minute window across the calling token. Single-rule queries are well within that limit; surfaces as 429 if hit.
388
+
389
+ ### Examples
390
+
391
+ ```ruby
392
+ require 'time'
393
+ require 'zernio-sdk'
394
+ # setup authorization
395
+ Zernio.configure do |config|
396
+ # Configure Bearer authorization (JWT): bearerAuth
397
+ config.access_token = 'YOUR_BEARER_TOKEN'
398
+ end
399
+
400
+ api_instance = Zernio::ConversionsApi.new
401
+ account_id = 'account_id_example' # String |
402
+ destination_id = 'destination_id_example' # String |
403
+ ad_account_id = 'ad_account_id_example' # String |
404
+ start_date = 'start_date_example' # String |
405
+ opts = {
406
+ end_date: 'end_date_example', # String |
407
+ granularity: 'ALL' # String |
408
+ }
409
+
410
+ begin
411
+ # Get attribution metrics
412
+ result = api_instance.get_conversion_metrics(account_id, destination_id, ad_account_id, start_date, opts)
413
+ p result
414
+ rescue Zernio::ApiError => e
415
+ puts "Error when calling ConversionsApi->get_conversion_metrics: #{e}"
416
+ end
417
+ ```
418
+
419
+ #### Using the get_conversion_metrics_with_http_info variant
420
+
421
+ This returns an Array which contains the response data, status code and headers.
422
+
423
+ > <Array(<GetConversionMetrics200Response>, Integer, Hash)> get_conversion_metrics_with_http_info(account_id, destination_id, ad_account_id, start_date, opts)
424
+
425
+ ```ruby
426
+ begin
427
+ # Get attribution metrics
428
+ data, status_code, headers = api_instance.get_conversion_metrics_with_http_info(account_id, destination_id, ad_account_id, start_date, opts)
429
+ p status_code # => 2xx
430
+ p headers # => { ... }
431
+ p data # => <GetConversionMetrics200Response>
432
+ rescue Zernio::ApiError => e
433
+ puts "Error when calling ConversionsApi->get_conversion_metrics_with_http_info: #{e}"
434
+ end
435
+ ```
436
+
437
+ ### Parameters
438
+
439
+ | Name | Type | Description | Notes |
440
+ | ---- | ---- | ----------- | ----- |
441
+ | **account_id** | **String** | | |
442
+ | **destination_id** | **String** | | |
443
+ | **ad_account_id** | **String** | | |
444
+ | **start_date** | **String** | | |
445
+ | **end_date** | **String** | | [optional] |
446
+ | **granularity** | **String** | | [optional][default to &#39;DAILY&#39;] |
447
+
448
+ ### Return type
449
+
450
+ [**GetConversionMetrics200Response**](GetConversionMetrics200Response.md)
451
+
452
+ ### Authorization
453
+
454
+ [bearerAuth](../README.md#bearerAuth)
455
+
456
+ ### HTTP request headers
457
+
458
+ - **Content-Type**: Not defined
459
+ - **Accept**: application/json
460
+
461
+
462
+ ## get_conversions_quality
463
+
464
+ > <GetConversionsQuality200Response> get_conversions_quality(account_id, destination_id)
465
+
466
+ Get Event Match Quality
467
+
468
+ Reads Meta Event Match Quality (EMQ) and pixel↔CAPI event coverage for a pixel/dataset, live from Meta's Dataset Quality API. Web events only (a Meta limitation). Meta-only; other platforms return 405. Requires the Ads add-on.
469
+
470
+ ### Examples
471
+
472
+ ```ruby
473
+ require 'time'
474
+ require 'zernio-sdk'
475
+ # setup authorization
476
+ Zernio.configure do |config|
477
+ # Configure Bearer authorization (JWT): bearerAuth
478
+ config.access_token = 'YOUR_BEARER_TOKEN'
479
+ end
480
+
481
+ api_instance = Zernio::ConversionsApi.new
482
+ account_id = 'account_id_example' # String | SocialAccount _id (must be a metaads account).
483
+ destination_id = 'destination_id_example' # String | Meta pixel/dataset ID.
484
+
485
+ begin
486
+ # Get Event Match Quality
487
+ result = api_instance.get_conversions_quality(account_id, destination_id)
488
+ p result
489
+ rescue Zernio::ApiError => e
490
+ puts "Error when calling ConversionsApi->get_conversions_quality: #{e}"
491
+ end
492
+ ```
493
+
494
+ #### Using the get_conversions_quality_with_http_info variant
495
+
496
+ This returns an Array which contains the response data, status code and headers.
497
+
498
+ > <Array(<GetConversionsQuality200Response>, Integer, Hash)> get_conversions_quality_with_http_info(account_id, destination_id)
499
+
500
+ ```ruby
501
+ begin
502
+ # Get Event Match Quality
503
+ data, status_code, headers = api_instance.get_conversions_quality_with_http_info(account_id, destination_id)
504
+ p status_code # => 2xx
505
+ p headers # => { ... }
506
+ p data # => <GetConversionsQuality200Response>
507
+ rescue Zernio::ApiError => e
508
+ puts "Error when calling ConversionsApi->get_conversions_quality_with_http_info: #{e}"
509
+ end
510
+ ```
511
+
512
+ ### Parameters
513
+
514
+ | Name | Type | Description | Notes |
515
+ | ---- | ---- | ----------- | ----- |
516
+ | **account_id** | **String** | SocialAccount _id (must be a metaads account). | |
517
+ | **destination_id** | **String** | Meta pixel/dataset ID. | |
518
+
519
+ ### Return type
520
+
521
+ [**GetConversionsQuality200Response**](GetConversionsQuality200Response.md)
522
+
523
+ ### Authorization
524
+
525
+ [bearerAuth](../README.md#bearerAuth)
526
+
527
+ ### HTTP request headers
528
+
529
+ - **Content-Type**: Not defined
530
+ - **Accept**: application/json
531
+
532
+
533
+ ## list_conversion_associations
534
+
535
+ > <ListConversionAssociations200Response> list_conversion_associations(account_id, destination_id, ad_account_id)
536
+
537
+ List associated campaigns
538
+
539
+ LinkedIn-only today. Returns the campaigns currently associated with this conversion rule. Note that auto-association on rule creation runs once at create time; campaigns created after the rule still need explicit association.
540
+
541
+ ### Examples
542
+
543
+ ```ruby
544
+ require 'time'
545
+ require 'zernio-sdk'
546
+ # setup authorization
547
+ Zernio.configure do |config|
548
+ # Configure Bearer authorization (JWT): bearerAuth
549
+ config.access_token = 'YOUR_BEARER_TOKEN'
550
+ end
551
+
552
+ api_instance = Zernio::ConversionsApi.new
553
+ account_id = 'account_id_example' # String |
554
+ destination_id = 'destination_id_example' # String |
555
+ ad_account_id = 'ad_account_id_example' # String |
556
+
557
+ begin
558
+ # List associated campaigns
559
+ result = api_instance.list_conversion_associations(account_id, destination_id, ad_account_id)
560
+ p result
561
+ rescue Zernio::ApiError => e
562
+ puts "Error when calling ConversionsApi->list_conversion_associations: #{e}"
563
+ end
564
+ ```
565
+
566
+ #### Using the list_conversion_associations_with_http_info variant
567
+
568
+ This returns an Array which contains the response data, status code and headers.
569
+
570
+ > <Array(<ListConversionAssociations200Response>, Integer, Hash)> list_conversion_associations_with_http_info(account_id, destination_id, ad_account_id)
571
+
572
+ ```ruby
573
+ begin
574
+ # List associated campaigns
575
+ data, status_code, headers = api_instance.list_conversion_associations_with_http_info(account_id, destination_id, ad_account_id)
576
+ p status_code # => 2xx
577
+ p headers # => { ... }
578
+ p data # => <ListConversionAssociations200Response>
579
+ rescue Zernio::ApiError => e
580
+ puts "Error when calling ConversionsApi->list_conversion_associations_with_http_info: #{e}"
581
+ end
582
+ ```
583
+
584
+ ### Parameters
585
+
586
+ | Name | Type | Description | Notes |
587
+ | ---- | ---- | ----------- | ----- |
588
+ | **account_id** | **String** | | |
589
+ | **destination_id** | **String** | | |
590
+ | **ad_account_id** | **String** | | |
591
+
592
+ ### Return type
593
+
594
+ [**ListConversionAssociations200Response**](ListConversionAssociations200Response.md)
595
+
596
+ ### Authorization
597
+
598
+ [bearerAuth](../README.md#bearerAuth)
599
+
600
+ ### HTTP request headers
601
+
602
+ - **Content-Type**: Not defined
603
+ - **Accept**: application/json
604
+
605
+
606
+ ## list_conversion_destinations
607
+
608
+ > <ListConversionDestinations200Response> list_conversion_destinations(account_id)
609
+
610
+ List conversion destinations
611
+
612
+ Returns the list of pixels (Meta), conversion actions (Google), or conversion rules (LinkedIn) accessible to the connected ads account. Use the returned `id` as `destinationId` when posting to `POST /v1/ads/conversions`. For Google and LinkedIn, each destination's `type` reflects the conversion type (PURCHASE, LEAD, SIGN_UP, etc.) — the event type is locked to the destination. For Meta, `type` is absent: pixels accept any event name per request. For LinkedIn, destinations are returned across every sponsored ad account the connected token can access; the `adAccountId` field on each destination identifies the parent ad account and is required for subsequent CRUD calls (update, delete, associations, metrics).
613
+
614
+ ### Examples
615
+
616
+ ```ruby
617
+ require 'time'
618
+ require 'zernio-sdk'
619
+ # setup authorization
620
+ Zernio.configure do |config|
621
+ # Configure Bearer authorization (JWT): bearerAuth
622
+ config.access_token = 'YOUR_BEARER_TOKEN'
623
+ end
624
+
625
+ api_instance = Zernio::ConversionsApi.new
626
+ account_id = 'account_id_example' # String | SocialAccount ID (metaads, googleads, linkedinads, or tiktokads).
627
+
628
+ begin
629
+ # List conversion destinations
630
+ result = api_instance.list_conversion_destinations(account_id)
631
+ p result
632
+ rescue Zernio::ApiError => e
633
+ puts "Error when calling ConversionsApi->list_conversion_destinations: #{e}"
634
+ end
635
+ ```
636
+
637
+ #### Using the list_conversion_destinations_with_http_info variant
638
+
639
+ This returns an Array which contains the response data, status code and headers.
640
+
641
+ > <Array(<ListConversionDestinations200Response>, Integer, Hash)> list_conversion_destinations_with_http_info(account_id)
642
+
643
+ ```ruby
644
+ begin
645
+ # List conversion destinations
646
+ data, status_code, headers = api_instance.list_conversion_destinations_with_http_info(account_id)
647
+ p status_code # => 2xx
648
+ p headers # => { ... }
649
+ p data # => <ListConversionDestinations200Response>
650
+ rescue Zernio::ApiError => e
651
+ puts "Error when calling ConversionsApi->list_conversion_destinations_with_http_info: #{e}"
652
+ end
653
+ ```
654
+
655
+ ### Parameters
656
+
657
+ | Name | Type | Description | Notes |
658
+ | ---- | ---- | ----------- | ----- |
659
+ | **account_id** | **String** | SocialAccount ID (metaads, googleads, linkedinads, or tiktokads). | |
660
+
661
+ ### Return type
662
+
663
+ [**ListConversionDestinations200Response**](ListConversionDestinations200Response.md)
664
+
665
+ ### Authorization
666
+
667
+ [bearerAuth](../README.md#bearerAuth)
668
+
669
+ ### HTTP request headers
670
+
671
+ - **Content-Type**: Not defined
672
+ - **Accept**: application/json
673
+
674
+
675
+ ## remove_conversion_associations
676
+
677
+ > <RemoveConversionAssociations200Response> remove_conversion_associations(account_id, destination_id, ad_account_id, campaign_ids)
678
+
679
+ Remove associated campaigns
680
+
681
+ Remove one or more campaign associations from this conversion rule. Pass `adAccountId` and `campaignIds` as query parameters (`campaignIds` is comma-separated). The route also accepts a JSON body with the same fields for clients that prefer DELETE-with-body, but the documented surface is query-only because some SDK code generators (e.g. Python) collapse query + body parameters with the same name into a single kwarg.
682
+
683
+ ### Examples
684
+
685
+ ```ruby
686
+ require 'time'
687
+ require 'zernio-sdk'
688
+ # setup authorization
689
+ Zernio.configure do |config|
690
+ # Configure Bearer authorization (JWT): bearerAuth
691
+ config.access_token = 'YOUR_BEARER_TOKEN'
692
+ end
693
+
694
+ api_instance = Zernio::ConversionsApi.new
695
+ account_id = 'account_id_example' # String |
696
+ destination_id = 'destination_id_example' # String |
697
+ ad_account_id = 'ad_account_id_example' # String |
698
+ campaign_ids = 'campaign_ids_example' # String | Comma-separated list of campaign IDs.
699
+
700
+ begin
701
+ # Remove associated campaigns
702
+ result = api_instance.remove_conversion_associations(account_id, destination_id, ad_account_id, campaign_ids)
703
+ p result
704
+ rescue Zernio::ApiError => e
705
+ puts "Error when calling ConversionsApi->remove_conversion_associations: #{e}"
706
+ end
707
+ ```
708
+
709
+ #### Using the remove_conversion_associations_with_http_info variant
710
+
711
+ This returns an Array which contains the response data, status code and headers.
712
+
713
+ > <Array(<RemoveConversionAssociations200Response>, Integer, Hash)> remove_conversion_associations_with_http_info(account_id, destination_id, ad_account_id, campaign_ids)
714
+
715
+ ```ruby
716
+ begin
717
+ # Remove associated campaigns
718
+ data, status_code, headers = api_instance.remove_conversion_associations_with_http_info(account_id, destination_id, ad_account_id, campaign_ids)
719
+ p status_code # => 2xx
720
+ p headers # => { ... }
721
+ p data # => <RemoveConversionAssociations200Response>
722
+ rescue Zernio::ApiError => e
723
+ puts "Error when calling ConversionsApi->remove_conversion_associations_with_http_info: #{e}"
724
+ end
725
+ ```
726
+
727
+ ### Parameters
728
+
729
+ | Name | Type | Description | Notes |
730
+ | ---- | ---- | ----------- | ----- |
731
+ | **account_id** | **String** | | |
732
+ | **destination_id** | **String** | | |
733
+ | **ad_account_id** | **String** | | |
734
+ | **campaign_ids** | **String** | Comma-separated list of campaign IDs. | |
735
+
736
+ ### Return type
737
+
738
+ [**RemoveConversionAssociations200Response**](RemoveConversionAssociations200Response.md)
739
+
740
+ ### Authorization
741
+
742
+ [bearerAuth](../README.md#bearerAuth)
743
+
744
+ ### HTTP request headers
745
+
746
+ - **Content-Type**: Not defined
747
+ - **Accept**: application/json
748
+
749
+
750
+ ## send_conversions
751
+
752
+ > <SendConversions200Response> send_conversions(send_conversions_request)
753
+
754
+ Send conversion events
755
+
756
+ Relay one or more conversion events to the target ad platform's native Conversions API. Platform is inferred from the provided `accountId`. Requires the Ads add-on. Supported platforms: - Meta (`metaads`) via Graph API - Google Ads (`googleads`) via Data Manager API `ingestEvents` - LinkedIn (`linkedinads`) via `/rest/conversionEvents` - TikTok (`tiktokads`) via the Offline Events API `/offline/batch/` — OFFLINE conversions only `destinationId` semantics differ per platform: - Meta: pixel (dataset) ID, e.g. `123456789012345` - Google: conversion action resource name, e.g. `customers/1234567890/conversionActions/987654321` - LinkedIn: conversion rule ID or URN, e.g. `104012` or `urn:lla:llaPartnerConversion:104012` - TikTok: Offline Event Set ID, e.g. `7057103914977558530` TikTok notes: this path sends OFFLINE conversions (in-store / CRM / call-center), not web-pixel events. Each event must carry an email or phone (TikTok requires at least one). The connected TikTok ads account must have granted the Offline Events permission; older grants must reconnect. Callers can list valid destinations via `GET /v1/accounts/{accountId}/conversion-destinations`. All PII (email, phone, names, external IDs) is hashed with SHA-256 server-side per each platform's normalization spec, including Google's Gmail-specific dot/plus-suffix stripping. Send plaintext. LinkedIn `externalIds` are passed through as plaintext per LinkedIn's spec; only emails and phones are hashed. For LinkedIn, the connected account must have been authorized after the Conversions API rollout (i.e. the OAuth grant must include `rw_conversions`). Older accounts must reconnect. Batching is handled automatically. Meta caps at 1000 events per request and rejects the entire batch if any event is malformed. Google caps at 2000. LinkedIn caps at 5000 and is also all-or-nothing per chunk. Dedup: pass a stable `eventId` on every event. Meta and LinkedIn use it to dedupe against browser-side pixel/Insight Tag events; Google maps it to `transactionId`. Per-platform `eventName` semantics: - Meta: free-form. Standard names (Purchase, Lead, ...) match Meta's built-in events; custom strings are accepted. - Google: ignored. The conversion action's category determines the event type. Send the standard name closest to your action for documentation, but the platform will not branch on it. - LinkedIn: ignored. The conversion rule's `type` (LEAD, PURCHASE, etc.) is locked to the destination at rule-creation time. Send the standard name for documentation; LinkedIn does not branch on it.
757
+
758
+ ### Examples
759
+
760
+ ```ruby
761
+ require 'time'
762
+ require 'zernio-sdk'
763
+ # setup authorization
764
+ Zernio.configure do |config|
765
+ # Configure Bearer authorization (JWT): bearerAuth
766
+ config.access_token = 'YOUR_BEARER_TOKEN'
767
+ end
768
+
769
+ api_instance = Zernio::ConversionsApi.new
770
+ send_conversions_request = Zernio::SendConversionsRequest.new({account_id: 'account_id_example', destination_id: 'destination_id_example', events: [Zernio::ConversionEvent.new({event_name: 'Purchase', event_time: 1744732800, event_id: 'order_abc_123', user: Zernio::ConversionEventUser.new})]}) # SendConversionsRequest |
771
+
772
+ begin
773
+ # Send conversion events
774
+ result = api_instance.send_conversions(send_conversions_request)
775
+ p result
776
+ rescue Zernio::ApiError => e
777
+ puts "Error when calling ConversionsApi->send_conversions: #{e}"
778
+ end
779
+ ```
780
+
781
+ #### Using the send_conversions_with_http_info variant
782
+
783
+ This returns an Array which contains the response data, status code and headers.
784
+
785
+ > <Array(<SendConversions200Response>, Integer, Hash)> send_conversions_with_http_info(send_conversions_request)
786
+
787
+ ```ruby
788
+ begin
789
+ # Send conversion events
790
+ data, status_code, headers = api_instance.send_conversions_with_http_info(send_conversions_request)
791
+ p status_code # => 2xx
792
+ p headers # => { ... }
793
+ p data # => <SendConversions200Response>
794
+ rescue Zernio::ApiError => e
795
+ puts "Error when calling ConversionsApi->send_conversions_with_http_info: #{e}"
796
+ end
797
+ ```
798
+
799
+ ### Parameters
800
+
801
+ | Name | Type | Description | Notes |
802
+ | ---- | ---- | ----------- | ----- |
803
+ | **send_conversions_request** | [**SendConversionsRequest**](SendConversionsRequest.md) | | |
804
+
805
+ ### Return type
806
+
807
+ [**SendConversions200Response**](SendConversions200Response.md)
808
+
809
+ ### Authorization
810
+
811
+ [bearerAuth](../README.md#bearerAuth)
812
+
813
+ ### HTTP request headers
814
+
815
+ - **Content-Type**: application/json
816
+ - **Accept**: application/json
817
+
818
+
819
+ ## update_conversion_destination
820
+
821
+ > <GetConversionDestination200Response> update_conversion_destination(account_id, destination_id, update_conversion_destination_request)
822
+
823
+ Update a conversion destination
824
+
825
+ Partial-update a conversion rule. LinkedIn-only today. Whitelisted fields: `name`, `enabled`, attribution windows, `valueType`, `value`, `attributionType`. The rule's `type` and parent ad account are intentionally not exposed for update — recreate the rule if those need to change.
826
+
827
+ ### Examples
828
+
829
+ ```ruby
830
+ require 'time'
831
+ require 'zernio-sdk'
832
+ # setup authorization
833
+ Zernio.configure do |config|
834
+ # Configure Bearer authorization (JWT): bearerAuth
835
+ config.access_token = 'YOUR_BEARER_TOKEN'
836
+ end
837
+
838
+ api_instance = Zernio::ConversionsApi.new
839
+ account_id = 'account_id_example' # String |
840
+ destination_id = 'destination_id_example' # String |
841
+ update_conversion_destination_request = Zernio::UpdateConversionDestinationRequest.new({ad_account_id: 'ad_account_id_example'}) # UpdateConversionDestinationRequest |
842
+
843
+ begin
844
+ # Update a conversion destination
845
+ result = api_instance.update_conversion_destination(account_id, destination_id, update_conversion_destination_request)
846
+ p result
847
+ rescue Zernio::ApiError => e
848
+ puts "Error when calling ConversionsApi->update_conversion_destination: #{e}"
849
+ end
850
+ ```
851
+
852
+ #### Using the update_conversion_destination_with_http_info variant
853
+
854
+ This returns an Array which contains the response data, status code and headers.
855
+
856
+ > <Array(<GetConversionDestination200Response>, Integer, Hash)> update_conversion_destination_with_http_info(account_id, destination_id, update_conversion_destination_request)
857
+
858
+ ```ruby
859
+ begin
860
+ # Update a conversion destination
861
+ data, status_code, headers = api_instance.update_conversion_destination_with_http_info(account_id, destination_id, update_conversion_destination_request)
862
+ p status_code # => 2xx
863
+ p headers # => { ... }
864
+ p data # => <GetConversionDestination200Response>
865
+ rescue Zernio::ApiError => e
866
+ puts "Error when calling ConversionsApi->update_conversion_destination_with_http_info: #{e}"
867
+ end
868
+ ```
869
+
870
+ ### Parameters
871
+
872
+ | Name | Type | Description | Notes |
873
+ | ---- | ---- | ----------- | ----- |
874
+ | **account_id** | **String** | | |
875
+ | **destination_id** | **String** | | |
876
+ | **update_conversion_destination_request** | [**UpdateConversionDestinationRequest**](UpdateConversionDestinationRequest.md) | | |
877
+
878
+ ### Return type
879
+
880
+ [**GetConversionDestination200Response**](GetConversionDestination200Response.md)
881
+
882
+ ### Authorization
883
+
884
+ [bearerAuth](../README.md#bearerAuth)
885
+
886
+ ### HTTP request headers
887
+
888
+ - **Content-Type**: application/json
889
+ - **Accept**: application/json
890
+