late-sdk 0.0.681 → 0.0.682
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.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/docs/Ad.md +2 -0
- data/docs/AdDailyMetrics.md +6 -0
- data/docs/AdEngagementCounts.md +34 -0
- data/docs/AdFunnelCounts.md +42 -0
- data/docs/AdMetrics.md +6 -0
- data/docs/GetCampaignAnalytics200ResponseAnalyticsDailyInner.md +6 -0
- data/docs/WebhookEventsApi.md +2 -2
- data/lib/zernio-sdk/api/webhook_events_api.rb +4 -4
- data/lib/zernio-sdk/models/ad.rb +24 -1
- data/lib/zernio-sdk/models/ad_daily_metrics.rb +29 -1
- data/lib/zernio-sdk/models/ad_engagement_counts.rb +229 -0
- data/lib/zernio-sdk/models/ad_funnel_counts.rb +269 -0
- data/lib/zernio-sdk/models/ad_metrics.rb +29 -1
- data/lib/zernio-sdk/models/get_campaign_analytics200_response_analytics_daily_inner.rb +29 -1
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +2 -0
- data/openapi.yaml +69 -3
- data/spec/models/ad_daily_metrics_spec.rb +18 -0
- data/spec/models/ad_engagement_counts_spec.rb +84 -0
- data/spec/models/ad_funnel_counts_spec.rb +108 -0
- data/spec/models/ad_metrics_spec.rb +18 -0
- data/spec/models/ad_spec.rb +10 -0
- data/spec/models/get_campaign_analytics200_response_analytics_daily_inner_spec.rb +18 -0
- data/zernio-sdk-0.0.682.gem +0 -0
- metadata +10 -2
- data/zernio-sdk-0.0.681.gem +0 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Zernio
|
|
17
|
+
# Named conversion-funnel steps, resolved from the same data as `actions` so you never have to parse action-type strings yourself. Meta reports one event under several action types at once (`offsite_conversion.fb_pixel_purchase`, `omni_purchase`, `purchase`, …). Each field below takes the FIRST family member present rather than summing them, which is what makes these counts safe to add up — summing the raw `actions` keys yourself double or triple counts. The same priority order backs `conversions`, so a purchase-optimised campaign reports the identical number in `conversions` and `funnel.purchases`. Every field is 0 when that step never fired. Populated for Meta ads; other platforms report a different action taxonomy and generally leave these at 0 (read `actions` for those). At ad-set and campaign level each step is summed from its per-ad values.
|
|
18
|
+
class AdFunnelCounts < ApiModelBase
|
|
19
|
+
# Landing page views — the visitor actually loaded the destination, unlike a link click. Meta `landing_page_view`.
|
|
20
|
+
attr_accessor :landing_page_views
|
|
21
|
+
|
|
22
|
+
# Content views (Meta `ViewContent` pixel event).
|
|
23
|
+
attr_accessor :content_views
|
|
24
|
+
|
|
25
|
+
# On-site searches (Meta `Search` pixel event).
|
|
26
|
+
attr_accessor :searches
|
|
27
|
+
|
|
28
|
+
# Adds to wishlist (Meta `AddToWishlist` pixel event).
|
|
29
|
+
attr_accessor :wishlist_adds
|
|
30
|
+
|
|
31
|
+
# Adds to cart (Meta `AddToCart` pixel event).
|
|
32
|
+
attr_accessor :cart_adds
|
|
33
|
+
|
|
34
|
+
# Checkouts started (Meta `InitiateCheckout` pixel event).
|
|
35
|
+
attr_accessor :checkouts_initiated
|
|
36
|
+
|
|
37
|
+
# Payment details added at checkout (Meta `AddPaymentInfo` pixel event).
|
|
38
|
+
attr_accessor :payment_info_adds
|
|
39
|
+
|
|
40
|
+
# Purchases (Meta `Purchase` pixel event). Pair with `purchaseValue` for revenue.
|
|
41
|
+
attr_accessor :purchases
|
|
42
|
+
|
|
43
|
+
# Leads, from either the website pixel or an instant form — whichever the ad uses.
|
|
44
|
+
attr_accessor :leads
|
|
45
|
+
|
|
46
|
+
# Completed registrations (Meta `CompleteRegistration` pixel event).
|
|
47
|
+
attr_accessor :registrations_completed
|
|
48
|
+
|
|
49
|
+
# Mobile app installs attributed to the ad.
|
|
50
|
+
attr_accessor :app_installs
|
|
51
|
+
|
|
52
|
+
# Messaging conversations started within 7 days — the headline metric for click-to-WhatsApp and click-to-Messenger ads.
|
|
53
|
+
attr_accessor :messaging_conversations_started
|
|
54
|
+
|
|
55
|
+
# Messaging threads where the person sent a first reply.
|
|
56
|
+
attr_accessor :messaging_first_replies
|
|
57
|
+
|
|
58
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
59
|
+
def self.attribute_map
|
|
60
|
+
{
|
|
61
|
+
:'landing_page_views' => :'landingPageViews',
|
|
62
|
+
:'content_views' => :'contentViews',
|
|
63
|
+
:'searches' => :'searches',
|
|
64
|
+
:'wishlist_adds' => :'wishlistAdds',
|
|
65
|
+
:'cart_adds' => :'cartAdds',
|
|
66
|
+
:'checkouts_initiated' => :'checkoutsInitiated',
|
|
67
|
+
:'payment_info_adds' => :'paymentInfoAdds',
|
|
68
|
+
:'purchases' => :'purchases',
|
|
69
|
+
:'leads' => :'leads',
|
|
70
|
+
:'registrations_completed' => :'registrationsCompleted',
|
|
71
|
+
:'app_installs' => :'appInstalls',
|
|
72
|
+
:'messaging_conversations_started' => :'messagingConversationsStarted',
|
|
73
|
+
:'messaging_first_replies' => :'messagingFirstReplies'
|
|
74
|
+
}
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Returns attribute mapping this model knows about
|
|
78
|
+
def self.acceptable_attribute_map
|
|
79
|
+
attribute_map
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Returns all the JSON keys this model knows about
|
|
83
|
+
def self.acceptable_attributes
|
|
84
|
+
acceptable_attribute_map.values
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Attribute type mapping.
|
|
88
|
+
def self.openapi_types
|
|
89
|
+
{
|
|
90
|
+
:'landing_page_views' => :'Integer',
|
|
91
|
+
:'content_views' => :'Integer',
|
|
92
|
+
:'searches' => :'Integer',
|
|
93
|
+
:'wishlist_adds' => :'Integer',
|
|
94
|
+
:'cart_adds' => :'Integer',
|
|
95
|
+
:'checkouts_initiated' => :'Integer',
|
|
96
|
+
:'payment_info_adds' => :'Integer',
|
|
97
|
+
:'purchases' => :'Integer',
|
|
98
|
+
:'leads' => :'Integer',
|
|
99
|
+
:'registrations_completed' => :'Integer',
|
|
100
|
+
:'app_installs' => :'Integer',
|
|
101
|
+
:'messaging_conversations_started' => :'Integer',
|
|
102
|
+
:'messaging_first_replies' => :'Integer'
|
|
103
|
+
}
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# List of attributes with nullable: true
|
|
107
|
+
def self.openapi_nullable
|
|
108
|
+
Set.new([
|
|
109
|
+
])
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Initializes the object
|
|
113
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
114
|
+
def initialize(attributes = {})
|
|
115
|
+
if (!attributes.is_a?(Hash))
|
|
116
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::AdFunnelCounts` initialize method"
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
120
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
121
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
122
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
123
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::AdFunnelCounts`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
124
|
+
end
|
|
125
|
+
h[k.to_sym] = v
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:'landing_page_views')
|
|
129
|
+
self.landing_page_views = attributes[:'landing_page_views']
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'content_views')
|
|
133
|
+
self.content_views = attributes[:'content_views']
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'searches')
|
|
137
|
+
self.searches = attributes[:'searches']
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if attributes.key?(:'wishlist_adds')
|
|
141
|
+
self.wishlist_adds = attributes[:'wishlist_adds']
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if attributes.key?(:'cart_adds')
|
|
145
|
+
self.cart_adds = attributes[:'cart_adds']
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if attributes.key?(:'checkouts_initiated')
|
|
149
|
+
self.checkouts_initiated = attributes[:'checkouts_initiated']
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if attributes.key?(:'payment_info_adds')
|
|
153
|
+
self.payment_info_adds = attributes[:'payment_info_adds']
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if attributes.key?(:'purchases')
|
|
157
|
+
self.purchases = attributes[:'purchases']
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if attributes.key?(:'leads')
|
|
161
|
+
self.leads = attributes[:'leads']
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
if attributes.key?(:'registrations_completed')
|
|
165
|
+
self.registrations_completed = attributes[:'registrations_completed']
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
if attributes.key?(:'app_installs')
|
|
169
|
+
self.app_installs = attributes[:'app_installs']
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if attributes.key?(:'messaging_conversations_started')
|
|
173
|
+
self.messaging_conversations_started = attributes[:'messaging_conversations_started']
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
if attributes.key?(:'messaging_first_replies')
|
|
177
|
+
self.messaging_first_replies = attributes[:'messaging_first_replies']
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
182
|
+
# @return Array for valid properties with the reasons
|
|
183
|
+
def list_invalid_properties
|
|
184
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
185
|
+
invalid_properties = Array.new
|
|
186
|
+
invalid_properties
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Check to see if the all the properties in the model are valid
|
|
190
|
+
# @return true if the model is valid
|
|
191
|
+
def valid?
|
|
192
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
193
|
+
true
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Checks equality by comparing each attribute.
|
|
197
|
+
# @param [Object] Object to be compared
|
|
198
|
+
def ==(o)
|
|
199
|
+
return true if self.equal?(o)
|
|
200
|
+
self.class == o.class &&
|
|
201
|
+
landing_page_views == o.landing_page_views &&
|
|
202
|
+
content_views == o.content_views &&
|
|
203
|
+
searches == o.searches &&
|
|
204
|
+
wishlist_adds == o.wishlist_adds &&
|
|
205
|
+
cart_adds == o.cart_adds &&
|
|
206
|
+
checkouts_initiated == o.checkouts_initiated &&
|
|
207
|
+
payment_info_adds == o.payment_info_adds &&
|
|
208
|
+
purchases == o.purchases &&
|
|
209
|
+
leads == o.leads &&
|
|
210
|
+
registrations_completed == o.registrations_completed &&
|
|
211
|
+
app_installs == o.app_installs &&
|
|
212
|
+
messaging_conversations_started == o.messaging_conversations_started &&
|
|
213
|
+
messaging_first_replies == o.messaging_first_replies
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# @see the `==` method
|
|
217
|
+
# @param [Object] Object to be compared
|
|
218
|
+
def eql?(o)
|
|
219
|
+
self == o
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# Calculates hash code according to all attributes.
|
|
223
|
+
# @return [Integer] Hash code
|
|
224
|
+
def hash
|
|
225
|
+
[landing_page_views, content_views, searches, wishlist_adds, cart_adds, checkouts_initiated, payment_info_adds, purchases, leads, registrations_completed, app_installs, messaging_conversations_started, messaging_first_replies].hash
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Builds the object from hash
|
|
229
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
230
|
+
# @return [Object] Returns the model itself
|
|
231
|
+
def self.build_from_hash(attributes)
|
|
232
|
+
return nil unless attributes.is_a?(Hash)
|
|
233
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
234
|
+
transformed_hash = {}
|
|
235
|
+
openapi_types.each_pair do |key, type|
|
|
236
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
237
|
+
transformed_hash["#{key}"] = nil
|
|
238
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
239
|
+
# check to ensure the input is an array given that the attribute
|
|
240
|
+
# is documented as an array but the input is not
|
|
241
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
242
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
243
|
+
end
|
|
244
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
245
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
246
|
+
end
|
|
247
|
+
end
|
|
248
|
+
new(transformed_hash)
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
# Returns the object in the form of hash
|
|
252
|
+
# @return [Hash] Returns the object in the form of hash
|
|
253
|
+
def to_hash
|
|
254
|
+
hash = {}
|
|
255
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
256
|
+
value = self.send(attr)
|
|
257
|
+
if value.nil?
|
|
258
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
259
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
hash[param] = _to_hash(value)
|
|
263
|
+
end
|
|
264
|
+
hash
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
end
|
|
@@ -80,6 +80,13 @@ module Zernio
|
|
|
80
80
|
# Average seconds watched per play (Meta `video_avg_time_watched_actions`). Aggregated over date ranges and across children as a play-weighted average (total watch time / total plays), never a plain average of averages.
|
|
81
81
|
attr_accessor :video_avg_time_watched_actions
|
|
82
82
|
|
|
83
|
+
# Derived `spend / videoThruplayWatchedActions`, in ad-account native currency. Rounded to 4 decimals rather than the usual 2 because a ThruPlay routinely costs well under a cent. 0 when the ad has no ThruPlays.
|
|
84
|
+
attr_accessor :cost_per_thruplay
|
|
85
|
+
|
|
86
|
+
attr_accessor :funnel
|
|
87
|
+
|
|
88
|
+
attr_accessor :engagement_breakdown
|
|
89
|
+
|
|
83
90
|
# Present on individual ads only, not on campaign aggregations
|
|
84
91
|
attr_accessor :last_synced_at
|
|
85
92
|
|
|
@@ -109,6 +116,9 @@ module Zernio
|
|
|
109
116
|
:'video_p95_watched_actions' => :'videoP95WatchedActions',
|
|
110
117
|
:'video_p100_watched_actions' => :'videoP100WatchedActions',
|
|
111
118
|
:'video_avg_time_watched_actions' => :'videoAvgTimeWatchedActions',
|
|
119
|
+
:'cost_per_thruplay' => :'costPerThruplay',
|
|
120
|
+
:'funnel' => :'funnel',
|
|
121
|
+
:'engagement_breakdown' => :'engagementBreakdown',
|
|
112
122
|
:'last_synced_at' => :'lastSyncedAt'
|
|
113
123
|
}
|
|
114
124
|
end
|
|
@@ -149,6 +159,9 @@ module Zernio
|
|
|
149
159
|
:'video_p95_watched_actions' => :'Integer',
|
|
150
160
|
:'video_p100_watched_actions' => :'Integer',
|
|
151
161
|
:'video_avg_time_watched_actions' => :'Float',
|
|
162
|
+
:'cost_per_thruplay' => :'Float',
|
|
163
|
+
:'funnel' => :'AdFunnelCounts',
|
|
164
|
+
:'engagement_breakdown' => :'AdEngagementCounts',
|
|
152
165
|
:'last_synced_at' => :'Time'
|
|
153
166
|
}
|
|
154
167
|
end
|
|
@@ -271,6 +284,18 @@ module Zernio
|
|
|
271
284
|
self.video_avg_time_watched_actions = attributes[:'video_avg_time_watched_actions']
|
|
272
285
|
end
|
|
273
286
|
|
|
287
|
+
if attributes.key?(:'cost_per_thruplay')
|
|
288
|
+
self.cost_per_thruplay = attributes[:'cost_per_thruplay']
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
if attributes.key?(:'funnel')
|
|
292
|
+
self.funnel = attributes[:'funnel']
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
if attributes.key?(:'engagement_breakdown')
|
|
296
|
+
self.engagement_breakdown = attributes[:'engagement_breakdown']
|
|
297
|
+
end
|
|
298
|
+
|
|
274
299
|
if attributes.key?(:'last_synced_at')
|
|
275
300
|
self.last_synced_at = attributes[:'last_synced_at']
|
|
276
301
|
end
|
|
@@ -319,6 +344,9 @@ module Zernio
|
|
|
319
344
|
video_p95_watched_actions == o.video_p95_watched_actions &&
|
|
320
345
|
video_p100_watched_actions == o.video_p100_watched_actions &&
|
|
321
346
|
video_avg_time_watched_actions == o.video_avg_time_watched_actions &&
|
|
347
|
+
cost_per_thruplay == o.cost_per_thruplay &&
|
|
348
|
+
funnel == o.funnel &&
|
|
349
|
+
engagement_breakdown == o.engagement_breakdown &&
|
|
322
350
|
last_synced_at == o.last_synced_at
|
|
323
351
|
end
|
|
324
352
|
|
|
@@ -331,7 +359,7 @@ module Zernio
|
|
|
331
359
|
# Calculates hash code according to all attributes.
|
|
332
360
|
# @return [Integer] Hash code
|
|
333
361
|
def hash
|
|
334
|
-
[spend, impressions, reach, clicks, ctr, cpc, cpm, engagement, conversions, cost_per_conversion, actions, action_values, purchase_value, roas, video_play_actions, video30_sec_watched_actions, video_thruplay_watched_actions, video_p25_watched_actions, video_p50_watched_actions, video_p75_watched_actions, video_p95_watched_actions, video_p100_watched_actions, video_avg_time_watched_actions, last_synced_at].hash
|
|
362
|
+
[spend, impressions, reach, clicks, ctr, cpc, cpm, engagement, conversions, cost_per_conversion, actions, action_values, purchase_value, roas, video_play_actions, video30_sec_watched_actions, video_thruplay_watched_actions, video_p25_watched_actions, video_p50_watched_actions, video_p75_watched_actions, video_p95_watched_actions, video_p100_watched_actions, video_avg_time_watched_actions, cost_per_thruplay, funnel, engagement_breakdown, last_synced_at].hash
|
|
335
363
|
end
|
|
336
364
|
|
|
337
365
|
# Builds the object from hash
|
|
@@ -80,6 +80,13 @@ module Zernio
|
|
|
80
80
|
# Average seconds watched per play (Meta `video_avg_time_watched_actions`). Aggregated over date ranges and across children as a play-weighted average (total watch time / total plays), never a plain average of averages.
|
|
81
81
|
attr_accessor :video_avg_time_watched_actions
|
|
82
82
|
|
|
83
|
+
# Derived `spend / videoThruplayWatchedActions`, in ad-account native currency. Rounded to 4 decimals rather than the usual 2 because a ThruPlay routinely costs well under a cent. 0 when the ad has no ThruPlays.
|
|
84
|
+
attr_accessor :cost_per_thruplay
|
|
85
|
+
|
|
86
|
+
attr_accessor :funnel
|
|
87
|
+
|
|
88
|
+
attr_accessor :engagement_breakdown
|
|
89
|
+
|
|
83
90
|
# Present on individual ads only, not on campaign aggregations
|
|
84
91
|
attr_accessor :last_synced_at
|
|
85
92
|
|
|
@@ -111,6 +118,9 @@ module Zernio
|
|
|
111
118
|
:'video_p95_watched_actions' => :'videoP95WatchedActions',
|
|
112
119
|
:'video_p100_watched_actions' => :'videoP100WatchedActions',
|
|
113
120
|
:'video_avg_time_watched_actions' => :'videoAvgTimeWatchedActions',
|
|
121
|
+
:'cost_per_thruplay' => :'costPerThruplay',
|
|
122
|
+
:'funnel' => :'funnel',
|
|
123
|
+
:'engagement_breakdown' => :'engagementBreakdown',
|
|
114
124
|
:'last_synced_at' => :'lastSyncedAt',
|
|
115
125
|
:'date' => :'date'
|
|
116
126
|
}
|
|
@@ -152,6 +162,9 @@ module Zernio
|
|
|
152
162
|
:'video_p95_watched_actions' => :'Integer',
|
|
153
163
|
:'video_p100_watched_actions' => :'Integer',
|
|
154
164
|
:'video_avg_time_watched_actions' => :'Float',
|
|
165
|
+
:'cost_per_thruplay' => :'Float',
|
|
166
|
+
:'funnel' => :'AdFunnelCounts',
|
|
167
|
+
:'engagement_breakdown' => :'AdEngagementCounts',
|
|
155
168
|
:'last_synced_at' => :'Time',
|
|
156
169
|
:'date' => :'Date'
|
|
157
170
|
}
|
|
@@ -282,6 +295,18 @@ module Zernio
|
|
|
282
295
|
self.video_avg_time_watched_actions = attributes[:'video_avg_time_watched_actions']
|
|
283
296
|
end
|
|
284
297
|
|
|
298
|
+
if attributes.key?(:'cost_per_thruplay')
|
|
299
|
+
self.cost_per_thruplay = attributes[:'cost_per_thruplay']
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
if attributes.key?(:'funnel')
|
|
303
|
+
self.funnel = attributes[:'funnel']
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
if attributes.key?(:'engagement_breakdown')
|
|
307
|
+
self.engagement_breakdown = attributes[:'engagement_breakdown']
|
|
308
|
+
end
|
|
309
|
+
|
|
285
310
|
if attributes.key?(:'last_synced_at')
|
|
286
311
|
self.last_synced_at = attributes[:'last_synced_at']
|
|
287
312
|
end
|
|
@@ -334,6 +359,9 @@ module Zernio
|
|
|
334
359
|
video_p95_watched_actions == o.video_p95_watched_actions &&
|
|
335
360
|
video_p100_watched_actions == o.video_p100_watched_actions &&
|
|
336
361
|
video_avg_time_watched_actions == o.video_avg_time_watched_actions &&
|
|
362
|
+
cost_per_thruplay == o.cost_per_thruplay &&
|
|
363
|
+
funnel == o.funnel &&
|
|
364
|
+
engagement_breakdown == o.engagement_breakdown &&
|
|
337
365
|
last_synced_at == o.last_synced_at &&
|
|
338
366
|
date == o.date
|
|
339
367
|
end
|
|
@@ -347,7 +375,7 @@ module Zernio
|
|
|
347
375
|
# Calculates hash code according to all attributes.
|
|
348
376
|
# @return [Integer] Hash code
|
|
349
377
|
def hash
|
|
350
|
-
[spend, impressions, reach, clicks, ctr, cpc, cpm, engagement, conversions, cost_per_conversion, actions, action_values, purchase_value, roas, video_play_actions, video30_sec_watched_actions, video_thruplay_watched_actions, video_p25_watched_actions, video_p50_watched_actions, video_p75_watched_actions, video_p95_watched_actions, video_p100_watched_actions, video_avg_time_watched_actions, last_synced_at, date].hash
|
|
378
|
+
[spend, impressions, reach, clicks, ctr, cpc, cpm, engagement, conversions, cost_per_conversion, actions, action_values, purchase_value, roas, video_play_actions, video30_sec_watched_actions, video_thruplay_watched_actions, video_p25_watched_actions, video_p50_watched_actions, video_p75_watched_actions, video_p95_watched_actions, video_p100_watched_actions, video_avg_time_watched_actions, cost_per_thruplay, funnel, engagement_breakdown, last_synced_at, date].hash
|
|
351
379
|
end
|
|
352
380
|
|
|
353
381
|
# Builds the object from hash
|
data/lib/zernio-sdk/version.rb
CHANGED
data/lib/zernio-sdk.rb
CHANGED
|
@@ -31,6 +31,8 @@ require 'zernio-sdk/models/ad_campaign_budget'
|
|
|
31
31
|
require 'zernio-sdk/models/ad_campaign_campaign_budget'
|
|
32
32
|
require 'zernio-sdk/models/ad_creative'
|
|
33
33
|
require 'zernio-sdk/models/ad_daily_metrics'
|
|
34
|
+
require 'zernio-sdk/models/ad_engagement_counts'
|
|
35
|
+
require 'zernio-sdk/models/ad_funnel_counts'
|
|
34
36
|
require 'zernio-sdk/models/ad_metrics'
|
|
35
37
|
require 'zernio-sdk/models/ad_promoted_object'
|
|
36
38
|
require 'zernio-sdk/models/ad_review_status'
|
data/openapi.yaml
CHANGED
|
@@ -134,7 +134,7 @@ x-documentation:
|
|
|
134
134
|
|
|
135
135
|
Receive real-time notifications for post status changes, account events, and incoming messages:
|
|
136
136
|
|
|
137
|
-
- `post.scheduled` - Post created
|
|
137
|
+
- `post.scheduled` - Post entered the scheduled state: created with a schedule, added to a queue, a draft promoted to scheduled or queued, a failed post retried, or a recycled clone created
|
|
138
138
|
- `post.published` - Post successfully published
|
|
139
139
|
- `post.failed` - Post failed on all platforms
|
|
140
140
|
- `post.partial` - Post published to some platforms, failed on others
|
|
@@ -6753,7 +6753,68 @@ components:
|
|
|
6753
6753
|
videoAvgTimeWatchedActions:
|
|
6754
6754
|
type: number
|
|
6755
6755
|
description: "Average seconds watched per play (Meta `video_avg_time_watched_actions`). Aggregated over date ranges and across children as a play-weighted average (total watch time / total plays), never a plain average of averages."
|
|
6756
|
+
costPerThruplay:
|
|
6757
|
+
type: number
|
|
6758
|
+
description: "Derived `spend / videoThruplayWatchedActions`, in ad-account native currency. Rounded to 4 decimals rather than the usual 2 because a ThruPlay routinely costs well under a cent. 0 when the ad has no ThruPlays."
|
|
6759
|
+
funnel:
|
|
6760
|
+
$ref: '#/components/schemas/AdFunnelCounts'
|
|
6761
|
+
engagementBreakdown:
|
|
6762
|
+
$ref: '#/components/schemas/AdEngagementCounts'
|
|
6756
6763
|
lastSyncedAt: { type: string, format: date-time, description: "Present on individual ads only, not on campaign aggregations" }
|
|
6764
|
+
AdFunnelCounts:
|
|
6765
|
+
type: object
|
|
6766
|
+
description: |
|
|
6767
|
+
Named conversion-funnel steps, resolved from the same data as `actions`
|
|
6768
|
+
so you never have to parse action-type strings yourself.
|
|
6769
|
+
|
|
6770
|
+
Meta reports one event under several action types at once
|
|
6771
|
+
(`offsite_conversion.fb_pixel_purchase`, `omni_purchase`, `purchase`, …).
|
|
6772
|
+
Each field below takes the FIRST family member present rather than
|
|
6773
|
+
summing them, which is what makes these counts safe to add up — summing
|
|
6774
|
+
the raw `actions` keys yourself double or triple counts. The same
|
|
6775
|
+
priority order backs `conversions`, so a purchase-optimised campaign
|
|
6776
|
+
reports the identical number in `conversions` and `funnel.purchases`.
|
|
6777
|
+
|
|
6778
|
+
Every field is 0 when that step never fired. Populated for Meta ads;
|
|
6779
|
+
other platforms report a different action taxonomy and generally leave
|
|
6780
|
+
these at 0 (read `actions` for those). At ad-set and campaign level each
|
|
6781
|
+
step is summed from its per-ad values.
|
|
6782
|
+
properties:
|
|
6783
|
+
landingPageViews: { type: integer, description: "Landing page views — the visitor actually loaded the destination, unlike a link click. Meta `landing_page_view`." }
|
|
6784
|
+
contentViews: { type: integer, description: "Content views (Meta `ViewContent` pixel event)." }
|
|
6785
|
+
searches: { type: integer, description: "On-site searches (Meta `Search` pixel event)." }
|
|
6786
|
+
wishlistAdds: { type: integer, description: "Adds to wishlist (Meta `AddToWishlist` pixel event)." }
|
|
6787
|
+
cartAdds: { type: integer, description: "Adds to cart (Meta `AddToCart` pixel event)." }
|
|
6788
|
+
checkoutsInitiated: { type: integer, description: "Checkouts started (Meta `InitiateCheckout` pixel event)." }
|
|
6789
|
+
paymentInfoAdds: { type: integer, description: "Payment details added at checkout (Meta `AddPaymentInfo` pixel event)." }
|
|
6790
|
+
purchases: { type: integer, description: "Purchases (Meta `Purchase` pixel event). Pair with `purchaseValue` for revenue." }
|
|
6791
|
+
leads: { type: integer, description: "Leads, from either the website pixel or an instant form — whichever the ad uses." }
|
|
6792
|
+
registrationsCompleted: { type: integer, description: "Completed registrations (Meta `CompleteRegistration` pixel event)." }
|
|
6793
|
+
appInstalls: { type: integer, description: "Mobile app installs attributed to the ad." }
|
|
6794
|
+
messagingConversationsStarted: { type: integer, description: "Messaging conversations started within 7 days — the headline metric for click-to-WhatsApp and click-to-Messenger ads." }
|
|
6795
|
+
messagingFirstReplies: { type: integer, description: "Messaging threads where the person sent a first reply." }
|
|
6796
|
+
AdEngagementCounts:
|
|
6797
|
+
type: object
|
|
6798
|
+
description: |
|
|
6799
|
+
The single `engagement` total split into the interactions behind it.
|
|
6800
|
+
|
|
6801
|
+
Note that `engagement` is not the sum of these: Meta's own
|
|
6802
|
+
`post_engagement` and `page_engagement` totals already contain the
|
|
6803
|
+
individual interactions, and all of them are counted into `engagement`.
|
|
6804
|
+
Use these fields when you need a specific interaction, and `engagement`
|
|
6805
|
+
only as the coarse total it has always been.
|
|
6806
|
+
|
|
6807
|
+
Meta-only; other platforms leave these at 0.
|
|
6808
|
+
properties:
|
|
6809
|
+
postEngagement: { type: integer, description: "Meta's own post-engagement total (`post_engagement`)." }
|
|
6810
|
+
pageEngagement: { type: integer, description: "Meta's own page-engagement total (`page_engagement`)." }
|
|
6811
|
+
reactions: { type: integer, description: "Reactions on the ad's post (`post_reaction`)." }
|
|
6812
|
+
comments: { type: integer, description: "Comments on the ad's post." }
|
|
6813
|
+
shares: { type: integer, description: "Shares of the ad's post. Meta reports these under the action type literally named `post`." }
|
|
6814
|
+
saves: { type: integer, description: "Saves of the ad's post (`onsite_conversion.post_save`)." }
|
|
6815
|
+
pageLikes: { type: integer, description: "New Page likes attributed to the ad (`like`)." }
|
|
6816
|
+
videoViews: { type: integer, description: "3-second video views (`video_view`). For completion-based counts use `videoThruplayWatchedActions`." }
|
|
6817
|
+
linkClicks: { type: integer, description: "Attributed link clicks (`link_click`). This is the attribution-window count, which differs from the in-session `inline_link_clicks` reported by `GET /v1/ads/{adId}/analytics`." }
|
|
6757
6818
|
AdDailyMetrics:
|
|
6758
6819
|
description: |
|
|
6759
6820
|
One day of metrics. Same fields as `AdMetrics` plus the `date` they
|
|
@@ -7095,6 +7156,11 @@ components:
|
|
|
7095
7156
|
allOf: [{ $ref: '#/components/schemas/AdReviewStatus' }]
|
|
7096
7157
|
description: "Platform review state of this ad, independent of delivery `status` / `configuredStatus`. Absent when the platform reports no review signal."
|
|
7097
7158
|
adType: { type: string, enum: [boost, standalone] }
|
|
7159
|
+
creativeType:
|
|
7160
|
+
type: [string, "null"]
|
|
7161
|
+
enum: [carousel, video, document, image, null]
|
|
7162
|
+
description: "Creative format, classified from the media the creative carries. `null` when the creative carries no media to classify — an unsynced creative and a genuine text-only ad are indistinguishable, so neither is guessed at. Returned by `GET /v1/ads`, `GET /v1/ads/{adId}` and the ad nodes of `GET /v1/ads/tree`."
|
|
7163
|
+
example: video
|
|
7098
7164
|
goal: { type: string, enum: [engagement, traffic, awareness, video_views, lead_generation, lead_conversion, conversions, app_promotion, catalog_sales, job_applicants], description: "Available goals vary by platform. Meta (Facebook/Instagram) supports all 9 (incl. `lead_conversion` = website pixel lead optimization and `catalog_sales` = Advantage+ catalog ads). TikTok supports the 7 non-`lead_conversion` goals. LinkedIn supports all except app_promotion / lead_conversion. Twitter/X supports engagement, traffic, awareness, video_views, app_promotion. Pinterest and Google Ads support only engagement, traffic, awareness, video_views." }
|
|
7099
7165
|
isExternal: { type: boolean, description: True for ads synced from platform ad managers }
|
|
7100
7166
|
budget:
|
|
@@ -7733,7 +7799,7 @@ webhooks:
|
|
|
7733
7799
|
post:
|
|
7734
7800
|
operationId: onPostScheduled
|
|
7735
7801
|
summary: Post scheduled event
|
|
7736
|
-
description: Fired
|
|
7802
|
+
description: 'Fired whenever a post enters the scheduled state: created with a schedule, added to a queue, a draft promoted to scheduled or queued, a failed or partial post retried, or a recycled clone created. Not fired when an already-scheduled post is edited or rescheduled.'
|
|
7737
7803
|
tags: [Webhook Events]
|
|
7738
7804
|
requestBody:
|
|
7739
7805
|
required: true
|
|
@@ -7808,7 +7874,7 @@ webhooks:
|
|
|
7808
7874
|
post:
|
|
7809
7875
|
operationId: onPostRecycled
|
|
7810
7876
|
summary: Post recycled event
|
|
7811
|
-
description: Fired when a post is recycled (cloned and re-scheduled for publishing).
|
|
7877
|
+
description: 'Fired when a post is recycled (cloned and re-scheduled for publishing). The new clone also fires a post.scheduled event.'
|
|
7812
7878
|
tags: [Webhook Events]
|
|
7813
7879
|
requestBody:
|
|
7814
7880
|
required: true
|
|
@@ -165,6 +165,24 @@ describe Zernio::AdDailyMetrics do
|
|
|
165
165
|
end
|
|
166
166
|
end
|
|
167
167
|
|
|
168
|
+
describe 'test attribute "cost_per_thruplay"' do
|
|
169
|
+
it 'should work' do
|
|
170
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
171
|
+
end
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
describe 'test attribute "funnel"' do
|
|
175
|
+
it 'should work' do
|
|
176
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
describe 'test attribute "engagement_breakdown"' do
|
|
181
|
+
it 'should work' do
|
|
182
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
|
|
168
186
|
describe 'test attribute "last_synced_at"' do
|
|
169
187
|
it 'should work' do
|
|
170
188
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Zernio::AdEngagementCounts
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zernio::AdEngagementCounts do
|
|
21
|
+
#let(:instance) { Zernio::AdEngagementCounts.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of AdEngagementCounts' do
|
|
24
|
+
it 'should create an instance of AdEngagementCounts' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Zernio::AdEngagementCounts)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "post_engagement"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe 'test attribute "page_engagement"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
describe 'test attribute "reactions"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
describe 'test attribute "comments"' do
|
|
49
|
+
it 'should work' do
|
|
50
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
describe 'test attribute "shares"' do
|
|
55
|
+
it 'should work' do
|
|
56
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
describe 'test attribute "saves"' do
|
|
61
|
+
it 'should work' do
|
|
62
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
describe 'test attribute "page_likes"' do
|
|
67
|
+
it 'should work' do
|
|
68
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
describe 'test attribute "video_views"' do
|
|
73
|
+
it 'should work' do
|
|
74
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
describe 'test attribute "link_clicks"' do
|
|
79
|
+
it 'should work' do
|
|
80
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
end
|