/*
* Zernio API
*
* API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
*
* The version of the OpenAPI document: 1.529.1
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// AdFunnelCounts : 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 takes the FIRST family member present rather than summing them, which 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. At ad-set and campaign level each step is summed from its per-ad values. - Meta ads: populated. - TikTok, from 2026-10-08: contentViews, cartAdds, checkoutsInitiated, purchases (app purchases, else website complete payments, else Place an Order) and leads. The other steps stay 0. - Other platforms report a different action taxonomy and generally leave these at 0 (read `actions` for those).
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AdFunnelCounts {
/// Landing page views: the visitor actually loaded the destination, unlike a link click. Meta `landing_page_view`.
#[serde(rename = "landingPageViews", skip_serializing_if = "Option::is_none")]
pub landing_page_views: Option<i32>,
/// Content views (Meta `ViewContent` pixel event).
#[serde(rename = "contentViews", skip_serializing_if = "Option::is_none")]
pub content_views: Option<i32>,
/// On-site searches (Meta `Search` pixel event).
#[serde(rename = "searches", skip_serializing_if = "Option::is_none")]
pub searches: Option<i32>,
/// Adds to wishlist (Meta `AddToWishlist` pixel event).
#[serde(rename = "wishlistAdds", skip_serializing_if = "Option::is_none")]
pub wishlist_adds: Option<i32>,
/// Adds to cart (Meta `AddToCart` pixel event).
#[serde(rename = "cartAdds", skip_serializing_if = "Option::is_none")]
pub cart_adds: Option<i32>,
/// Checkouts started (Meta `InitiateCheckout` pixel event).
#[serde(rename = "checkoutsInitiated", skip_serializing_if = "Option::is_none")]
pub checkouts_initiated: Option<i32>,
/// Payment details added at checkout (Meta `AddPaymentInfo` pixel event).
#[serde(rename = "paymentInfoAdds", skip_serializing_if = "Option::is_none")]
pub payment_info_adds: Option<i32>,
/// Purchases. Pair with `purchaseValue` for revenue. **Meta** reports one purchase under several action types, so this takes the FIRST present, in this order, never a sum: `offsite_conversion.fb_pixel_purchase`, `omni_purchase`, `app_custom_event.fb_mobile_purchase`, `onsite_conversion.purchase`, `purchase`. It always counts purchases, whatever the ad set optimizes for. `conversions` instead follows the ad set's optimization event (PURCHASE when none is named), so the two can differ on any other goal. **TikTok:** app purchases (`purchase`), else website complete payments (`complete_payment`), else Place an Order (`place_order`).
#[serde(rename = "purchases", skip_serializing_if = "Option::is_none")]
pub purchases: Option<i32>,
/// Leads, from either the website pixel or an instant form, whichever the ad uses.
#[serde(rename = "leads", skip_serializing_if = "Option::is_none")]
pub leads: Option<i32>,
/// Completed registrations (Meta `CompleteRegistration` pixel event).
#[serde(
rename = "registrationsCompleted",
skip_serializing_if = "Option::is_none"
)]
pub registrations_completed: Option<i32>,
/// Mobile app installs attributed to the ad.
#[serde(rename = "appInstalls", skip_serializing_if = "Option::is_none")]
pub app_installs: Option<i32>,
/// Messaging conversations started within 7 days, the headline metric for click-to-WhatsApp and click-to-Messenger ads.
#[serde(
rename = "messagingConversationsStarted",
skip_serializing_if = "Option::is_none"
)]
pub messaging_conversations_started: Option<i32>,
/// Messaging threads where the person sent a first reply.
#[serde(
rename = "messagingFirstReplies",
skip_serializing_if = "Option::is_none"
)]
pub messaging_first_replies: Option<i32>,
/// Booked appointments (Meta `Schedule` pixel event). Pair with `spend` for cost per booked meeting. **Meta** reports Schedule in its `conversions` insight field, never in `actions`. This takes the FIRST present of `offsite_conversion.fb_pixel_schedule`, `omni_schedule`, `app_custom_event.fb_mobile_schedule`, `onsite_conversion.schedule`, `schedule`, `schedule_total`, `schedule_mobile_app`, `schedule_website`, `schedule_offline`. With none of those, a single `offsite_schedule_add_<dataset>` key counts. Two such keys (two datasets) leave it at 0, since one booking can reach both. Added 2026-11-03. Days synced before then read 0 until re-fetched: each sync restates the last 30 days.
#[serde(rename = "schedules", skip_serializing_if = "Option::is_none")]
pub schedules: Option<i32>,
}
impl AdFunnelCounts {
/// 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 takes the FIRST family member present rather than summing them, which 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. At ad-set and campaign level each step is summed from its per-ad values. - Meta ads: populated. - TikTok, from 2026-10-08: contentViews, cartAdds, checkoutsInitiated, purchases (app purchases, else website complete payments, else Place an Order) and leads. The other steps stay 0. - Other platforms report a different action taxonomy and generally leave these at 0 (read `actions` for those).
pub fn new() -> AdFunnelCounts {
AdFunnelCounts {
landing_page_views: None,
content_views: None,
searches: None,
wishlist_adds: None,
cart_adds: None,
checkouts_initiated: None,
payment_info_adds: None,
purchases: None,
leads: None,
registrations_completed: None,
app_installs: None,
messaging_conversations_started: None,
messaging_first_replies: None,
schedules: None,
}
}
}