pepperwind / docs /marketing.md
rasinmuhammed's picture
Pepperwind Trading Co. preview, version 1.0
27ec678 verified
|
Raw History Blame Contribute Delete
16.3 kB

marketing

Pepperwind's marketing data: the campaign calendar, the email platform Sendmara (shaped like Klaviyo or Mailchimp, with SendGrid-shaped webhook events) with its subscription statuses, sends and events, campaign audiences including the Monsoon Chai 2025 holdout test, and the daily reports of the two ad platforms, Palaver Ads (shaped like Meta's) and Querent Ads (shaped like Google Ads). Every platform name is invented. customer_id is the storefront's customer id from commerce; UTM touches and attribution live in product. Times are UTC.

Table Rows What it holds
ad_spend_daily 19,575 One paid campaign's day in its ad account's daily report: cost, impressions and clicks. The date is the ad account's own day, in its market's time zone, and money is in the account's currency.
campaign 264 One campaign on the marketing calendar: a planned piece of marketing with one channel, one market, dates and, if paid, a budget. A newsletter is one campaign per market per financial year, and an automated email flow one per market per version. Campaigns that began before October 2023 keep their real start date.
campaign_member 5,005 One customer record in one campaign's audience. A campaign run with a holdout splits its eligible customers into treatment and holdout; for every other campaign a member is a recipient, added when the campaign first sent to them or when a flow was triggered.
campaign_message 1,024 One scheduled email of a campaign to one market's subscribers or a segment of them.
consent 750 One change to a customer record's email subscription status on the email platform. A record's first row is the status it began with; later rows are a German double opt-in confirmation, a lapse, an unsubscribe, a spam complaint or a hard bounce, the withdrawals applied on 6 Jul 2026, a yes to the 2026 re-permission email, and a deletion or opt-out request to the privacy desk, after which the record is sent nothing. The current status is the record's latest row.
email_event 57,683 One webhook event the email platform reported for a send, with SendGrid's event types. A send has one delivery outcome and any number of opens and clicks.
email_send 36,742 One email to one customer record: a campaign message, a step of an automated flow (welcome, abandoned cart, browse abandonment, the brew guide after a purchase, review request, replenishment, win-back, sunset), or a re-permission ask. Nothing is sent to a record after a send that unsubscribed, bounced or drew a complaint.
utm_map 176 One raw (utm_source, utm_medium) pair seen on tagged links, with the canonical source and channel the data team mapped it to. Use it to group the many spellings people type for one source.

ad_spend_daily

One paid campaign's day in its ad account's daily report: cost, impressions and clicks. The date is the ad account's own day, in its market's time zone, and money is in the account's currency.

19,575 rows; key spend_row_id.

Column Type Empty Range or values Meaning
spend_row_id integer, key 0.0% 1 to 19575 The row's id.
date timestamp, UTC instant 0.0% 2023-10-01 00:00:00 to 2026-09-30 00:00:00 The ad account's day the row reports (a date, in the account's time zone).
platform text 0.0% Palaver Ads, Querent Ads The ad platform: Palaver Ads (paid social) or Querent Ads (search, shopping and app installs).
ad_account text 0.0% act_304387383467379, 1227423424, act_776689633560507 The ad account's id on its platform: act_ and 15 digits on Palaver Ads, a 10-digit customer id on Querent Ads. One account per platform and market.
ad_campaign_ref text 0.0% 120950632652853387, 120110406667079392, 120375181422828767 The platform's own id for the campaign.
campaign_code text 0.0% CMP-2021-002, CMP-2022-010, CMP-2022-011 Pepperwind's code for the campaign (campaign.campaign_code).
market_code text 0.0% IN, US, EU The market the campaign runs in: IN, EU or US.
currency text 0.0% INR, USD, EUR The ad account's currency: INR, EUR or USD.
cost number, 2 places 0.0% 0.05 to 177.77 What the campaign spent that day, in the account's currency (a decimal amount, not minor units).
impressions integer 0.0% 0 to 1658 Impressions served that day.
clicks integer 0.0% 0 to 25 Link clicks that day.
reported_at timestamp, UTC instant 0.0% 2023-10-01 22:46:45 to 2026-10-01 10:48:41 When the platform's report for the day was taken: the next morning, 04:00-07:00 in the account's time zone.

campaign

One campaign on the marketing calendar: a planned piece of marketing with one channel, one market, dates and, if paid, a budget. A newsletter is one campaign per market per financial year, and an automated email flow one per market per version. Campaigns that began before October 2023 keep their real start date.

264 rows; key campaign_id.

Column Type Empty Range or values Meaning
campaign_id integer, key 0.0% 1 to 264 The campaign's id.
campaign_code text 0.0% CMP-2019-001, CMP-2019-002, CMP-2020-001 The campaign's code, CMP--<3 digits>, numbered within its start year. Storefront promotions and UTM links refer to campaigns by it.
name text 0.0% IN Abandoned Cart v1, IN Post Purchase v1, IN Review Request v1 The campaign's name as the team wrote it; paid campaigns read | | .
channel text 0.0% email, paid_social, referral email, messaging, paid_social, paid_search, paid_shopping, app_install, creator, referral or trade.
market_code text 0.0% IN, US, EU The market the campaign runs in: IN, EU or US.
objective text 0.0% retention, acquisition, club_acquisition acquisition, retention, reactivation, launch, club_acquisition, b2b_leads or consent (asking customers to opt in again).
start_date timestamp, UTC instant 0.0% 2019-07-01 00:00:00 to 2026-08-18 00:00:00 The campaign's first day.
end_date timestamp, UTC instant 18.2% 2023-10-20 00:00:00 to 2027-03-31 00:00:00 The campaign's last day. Empty for always-on campaigns and flows still running.
budget number, 2 places 62.1% 5.0 to 49000.0 The planned spend in the campaign's currency, for paid campaigns. Empty for email, messaging, creator, referral and trade campaigns, whose costs are paid as vendor invoices.
currency text 0.0% INR, USD, EUR The campaign's currency: INR, EUR or USD.
owner_employee_no text 0.0% EMP-10020, EMP-10077, EMP-10018 The employee number of the campaign's owner on its start date.
has_holdout boolean 0.0% False to True True only for Monsoon Chai 2025, which held back 10% of its eligible audience as a control group.

campaign_member

One customer record in one campaign's audience. A campaign run with a holdout splits its eligible customers into treatment and holdout; for every other campaign a member is a recipient, added when the campaign first sent to them or when a flow was triggered.

5,005 rows; key member_id.

Column Type Empty Range or values Meaning
member_id integer, key 0.0% 1 to 5005 The row's id.
customer_id text, → commerce.customer.customer_id 0.0% cus_1XudikaNGJg7p0, cus_FE5xBzLw3iEKcn, cus_ESbFpXpoH5C4zf The customer in the audience.
campaign_id integer, → marketing.campaign.campaign_id 0.0% 1 to 264 The campaign.
arm text 0.0% all, treatment, holdout treatment or holdout for Monsoon Chai 2025 (the holdout received none of its emails); all for every other campaign.
added_at timestamp, UTC instant 0.0% 2023-10-03 10:23:10 to 2026-09-30 12:31:40 When the customer was added: for Monsoon Chai 2025, the audience export on 13 Jun 2025; otherwise minutes before a campaign's first send to them, or seconds before a flow email.

campaign_message

One scheduled email of a campaign to one market's subscribers or a segment of them.

1,024 rows; key campaign_message_id.

Column Type Empty Range or values Meaning
campaign_message_id integer, key 0.0% 1 to 1024 The message's id.
campaign_id integer, → marketing.campaign.campaign_id 0.0% 34 to 264 The campaign the message belongs to.
market_code text 0.0% IN, US, EU The market whose audience receives it: IN, EU or US.
scheduled_at timestamp, UTC instant 0.0% 2023-10-01 14:00:00 to 2026-09-30 14:00:00 When the send was scheduled to start.
audience text 0.0% all, group, monsoon Who receives it: all (the market's subscribers), group (a segment, such as Kerala), monsoon (Monsoon Chai 2025's treatment arm) or re_permission (customers asked in 2026 to opt in again).
template text 0.0% launch_story, newsletter_v1, promo_hero The email template: newsletter_v1, newsletter_v2 (the redesign from 1 Apr 2025), promo_hero, promo_grid, launch_story or re_permission.

consent

One change to a customer record's email subscription status on the email platform. A record's first row is the status it began with; later rows are a German double opt-in confirmation, a lapse, an unsubscribe, a spam complaint or a hard bounce, the withdrawals applied on 6 Jul 2026, a yes to the 2026 re-permission email, and a deletion or opt-out request to the privacy desk, after which the record is sent nothing. The current status is the record's latest row.

750 rows; key consent_id.

Column Type Empty Range or values Meaning
consent_id integer, key 0.0% 1 to 750 The row's id.
customer_id text, → commerce.customer.customer_id 0.0% cus_GVea5gbJSpUZT3, cus_ETD6Ht16UvKNxK, cus_EDfPCudJXtBA7g The customer record.
captured_at timestamp, UTC instant 0.0% 2017-09-13 05:37:29 to 2026-09-29 04:03:57 When the status was set.
policy_version integer 0.0% 1 to 3 The privacy policy in force: 1 until 31 Jan 2024, 2 from 1 Feb 2024, 3 from 1 Jun 2026.
status text 0.0% subscribed, unsubscribed, cleaned subscribed; pending (a German sign-up not yet confirmed by email); transactional (never opted in: order and service mail only); unsubscribed; or cleaned (removed after a hard bounce).
source text 0.0% import, unsubscribe_link, hard_bounce How the status was set: checkout_checkbox, signup_popup, account_signup, footer_form, import (a record carried over from India's earlier list), double_opt_in_confirm, unsubscribe_link, spam_complaint, hard_bounce, privacy_backfill, re_permission or privacy_request (the privacy desk received a deletion or opt-out request from the customer). privacy_backfill marks records whose consent rested on India's pre-ticked sign-up box: the privacy desk withdrew those consents in May and June 2026, and the platform applied the withdrawals on 6 Jul 2026, so they were mailed until then.
channel text 0.0% email The channel the consent covers; always email.

email_event

One webhook event the email platform reported for a send, with SendGrid's event types. A send has one delivery outcome and any number of opens and clicks.

57,683 rows; key email_event_id.

Column Type Empty Range or values Meaning
email_event_id integer, key 0.0% 1 to 57683 The event's id.
send_id integer, → marketing.email_send.send_id 0.0% 1 to 36742 The send the event is about.
occurred_at timestamp, UTC instant 0.0% 2023-10-03 14:01:40 to 2026-09-30 17:32:19 When the event happened.
type text 0.0% delivered, open, click deferred, delivered, bounce, open, click, unsubscribe or spamreport.
is_machine_open boolean 65.5% False to True On an open, true for every open by a recipient on Apple Mail Privacy Protection: the automatic image fetch soon after delivery and any later real read alike. Empty on other event types.
user_agent text 64.0% Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy), Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148, Mozilla/5.0 (generic) The user agent of an open: the reader's mail client, Gmail's image proxy, or a generic one for machine opens. Empty on other event types.
url text 98.6% https://pepperwind.example/c/cmp-2023-020?utm_source=pepperwind&utm_medium=email&utm_campaign=cmp-2023-020, https://us.pepperwind.example/c/cmp-2022-003?utm_source=sendmara&utm_medium=email&utm_campaign=cmp-2022-003, https://pepperwind.example/c/cmp-2023-020?utm_source=newsletter&utm_medium=email&utm_campaign=cmp-2023-020 The link clicked, with the UTM parameters set when the email was built. Empty on other event types.

email_send

One email to one customer record: a campaign message, a step of an automated flow (welcome, abandoned cart, browse abandonment, the brew guide after a purchase, review request, replenishment, win-back, sunset), or a re-permission ask. Nothing is sent to a record after a send that unsubscribed, bounced or drew a complaint.

36,742 rows; key send_id.

Column Type Empty Range or values Meaning
send_id integer, key 0.0% 1 to 36742 The send's id.
customer_id text, → commerce.customer.customer_id 0.0% cus_ESbFpXpoH5C4zf, cus_3CjREDByICiHjR, cus_3eoHnIa5zcOwiW The customer record the email went to.
sent_at timestamp, UTC instant 0.0% 2023-10-03 14:01:27 to 2026-09-30 14:24:33 When the email was sent.
campaign_id integer, → marketing.campaign.campaign_id 0.0% 1 to 264 The campaign or flow the email belongs to.
template text 0.0% newsletter_v1, launch_story, flow_welcome The template: a campaign message's (newsletter_v1, newsletter_v2, promo_hero, promo_grid, launch_story), a flow's (flow_welcome, flow_cart, flow_browse, flow_brew_guide, flow_review, flow_replenish, flow_winback, flow_sunset) or re_permission.
to_email text 2.2% sverma@webmail.example, divya.jois74@inbox.example, akash.garg@usmail.example The address the email went to: the customer's email address in force when it was sent. Empty on every send to a customer whose deletion the privacy desk completed.
message_id text 0.0% <20231003100127.98c7166e@mail.pepperwind.example>, <20231003100236.ddef575d@mail.pepperwind.example>, <20231003100424.2f28f821@mail.pepperwind.example> The email's RFC 5322 Message-ID on the sending domain mail.pepperwind.example.

utm_map

One raw (utm_source, utm_medium) pair seen on tagged links, with the canonical source and channel the data team mapped it to. Use it to group the many spellings people type for one source.

176 rows; key map_id.

Column Type Empty Range or values Meaning
map_id integer, key 0.0% 1 to 176 The row's id.
raw_key text 0.0% creator|influencer, influencer|influencer, shutterbloom|influencer The raw pair as one key: utm_source|utm_medium.
raw_source text 0.0% creator, influencer, shutterbloom utm_source exactly as typed, case and spacing kept.
raw_medium text 0.0% influencer, creator, affiliate utm_medium exactly as typed.
canonical_source text 0.0% creator, natterline, newsletter The source it maps to, for example palaver, shutterbloom, querent, newsletter, natterline, creator or referral.
canonical_channel text 0.0% creator, messaging, email The channel it maps to: paid_social, organic_social, paid_search, paid_shopping, email, messaging, creator or referral.