raw-schema.md

Part of the marketing-automation-analysis skill

Marketo raw connector schema

Reference for the raw Marketo connector tables that Fivetran syncs (the raw_schema source for the fivetran/marketo dbt package). Use this when:

  • model_tier == 'raw' — the dbt package isn't deployed and queries must go directly against connector tables.
  • A question requires event-level detail the QDM rolls up (e.g. "the exact timestamp lead X opened email Y", or "what device was used to open this send"). The dbt models aggregate; raw tables preserve every event.

Source of truth: fivetran/dbt_marketo_source/models/src_marketo.yml. Authored by Fivetran. The dbt package consumes these tables; the connector syncs them.

Coverage caveat: The 14 tables below are what the dbt package documents and consumes. The Marketo connector may sync additional tables that the dbt package doesn't use (e.g. activity_visit_webpage, activity_fill_out_form, form, list, smart_list, segmentation, program_membership_history). Their schemas aren't enumerated here — use Discovery Mode (bq ls, bq show --schema) on the destination to inspect them when needed.

lead — one row per Marketo lead

ColumnNotes
idINTEGER. Primary key (joins to activity_*.lead_id).
created_atTIMESTAMP. When the lead was created.
updated_atTIMESTAMP. When the lead was last updated.
emailSTRING. Email address.
first_name, last_name, phone, main_phone, mobile_phoneSTRING. Lead identity.
company, inferred_companySTRING. Declared vs reverse-IP inferred company.
address, address_lead, city, state, state_code, country, country_code, postal_codeSTRING. Lead's stated geo.
billing_street, billing_city, billing_state, billing_state_code, billing_country, billing_country_code, billing_postal_codeSTRING. Billing geo.
inferred_city, inferred_state_region, inferred_country, inferred_postal_code, inferred_phone_area_codeSTRING. Reverse-IP inferred geo.
anonymous_ipSTRING. IP from first recorded web visit.
unsubscribedBOOLEAN. Email unsubscribe status.
email_invalidBOOLEAN. Hard-bounce / invalid email flag.
do_not_callBOOLEAN. DNC preference.

lead_describe — metadata about lead-object columns

ColumnNotes
idINTEGER. Field id.
display_nameSTRING. UI label.
data_typeSTRING. Field's datatype.
lengthINTEGER. Max length for text fields.
restname, soapnameSTRING. REST and SOAP API field names.
restread_only, soapread_onlyBOOLEAN. Whether the field is read-only via that API.

campaign — one row per Marketo campaign

ColumnNotes
idINTEGER. Primary key.
nameSTRING. Display name.
typeSTRING. batch or trigger.
statusSTRING. Campaign status.
activeBOOLEAN. Whether trigger campaign is currently active.
descriptionSTRING.
program_idINTEGER. Joins to program.id.
workspace_nameSTRING. Marketo workspace.
created_at, updated_atTIMESTAMP.
computed_url, flow_idSTRING. UI url and flow reference.
folder_id, folder_typeFolder grouping.
is_communication_limit_enabled, is_requestable, is_systemBOOLEAN. Campaign flags.
max_membersINTEGER. Member cap.
qualification_rule_type, qualification_rule_interval, qualification_rule_unitQualification frequency rules.
recurrence_start_at, recurrence_end_at, recurrence_interval_type, recurrence_interval, recurrence_weekday_only, recurrence_day_of_month, recurrence_day_of_week, recurrence_week_of_monthRecurrence schedule.
smart_list_idINTEGER. Associated smart list.
_fivetran_deletedBOOLEAN. Filter = false to exclude soft-deleted rows.

program — one row per Marketo program

ColumnNotes
idINTEGER. Primary key.
nameSTRING. Display name.
typeSTRING. dbt-documented allowed values: program, event, webinar, nurture. Customer-configured — actual values vary (Email, Engagement, Default, EventWithWebinar are common in real instances).
statusSTRING. locked, unlocked, on, off (email and engagement programs only).
channelSTRING. Marketo channel.
descriptionSTRING.
workspaceSTRING. Marketo workspace.
start_date, end_dateTIMESTAMP. For event/webinar/email programs.
sfdc_id, sfdc_nameSTRING. Linked Salesforce campaign, if any.
created_at, updated_atTIMESTAMP.
urlSTRING. UI url.
_fivetran_deletedBOOLEAN. Filter = false to exclude soft-deleted rows.

email_template_history — one row per email template version

ColumnNotes
idINTEGER. Template id (not unique per row — see version).
versionSTRING. Template version (1 or 2). Use the most recent per id.
nameSTRING. Display name.
subjectSTRING. Subject line.
from_email, from_nameSTRING. Sender identity.
reply_emailSTRING. Reply-to.
program_idINTEGER. Joins to program.id.
descriptionSTRING.
templateINTEGER. Parent template id.
operationalBOOLEAN. Operational emails bypass unsubscribe status.
publish_to_msiBOOLEAN. Published to Marketo Sales Insight.
text_onlyBOOLEAN. Include text-only version.
web_viewBOOLEAN. "View as Webpage" enabled.
statusSTRING. Draft or approved.
urlSTRING. UI url.
workspaceSTRING. Marketo workspace.
folder_id, folder_type, folder_value, folder_folder_nameFolder grouping.
created_at, updated_atTIMESTAMP.

Activity tables — one row per event of that type

These eleven activity_* tables share a core column set (id, activity_date, activity_type_id, lead_id, primary_attribute_value, primary_attribute_value_id). Email-related activities also share campaign / template / flow attribution columns. The shared columns are documented once below; type-specific columns are listed per table.

Shared columns across all activity_* tables:

ColumnNotes
idSTRING / INTEGER. Activity id.
lead_idINTEGER. Joins to lead.id.
activity_dateTIMESTAMP. When the event happened.
activity_type_idINTEGER. Marketo activity-type id.
primary_attribute_valueSTRING. Activity's primary attribute (varies by type).
primary_attribute_value_idINTEGER. Id of the primary attribute.

Shared columns across email activity_* tables (send_email, email_delivered, email_bounced, open_email, click_email, unsubscribe_email):

ColumnNotes
campaign_idINTEGER. Joins to campaign.id.
campaign_run_idINTEGER. Specific campaign execution.
email_template_idINTEGER. Joins to email_template_history.id.
step_idINTEGER. Flow step that triggered the activity.
choice_numberINTEGER. Branch choice within the flow step.

activity_send_email — email send events

Additional columns:

ColumnNotes
action_resultSTRING. Outcome of the action within Marketo.

activity_email_delivered — successful delivery events

No type-specific columns beyond the shared set.

activity_email_bounced — bounce events

Additional columns:

ColumnNotes
emailSTRING. The address that bounced.
categorySTRING. Bounce category (e.g. hard, soft).
subcategorySTRING. Sub-category detail.
detailsSTRING. Why the email bounced.

activity_open_email — open events

Additional columns:

ColumnNotes
deviceSTRING. Device type opened on.
is_mobile_deviceBOOLEAN.
platformSTRING. Platform (e.g. iOS, Android, Outlook).
user_agentSTRING. Browser user agent.

activity_click_email — click events

Additional columns:

ColumnNotes
linkSTRING. URL clicked.
deviceSTRING. Device type.
is_mobile_deviceBOOLEAN.
user_agentSTRING. Browser user agent.

activity_unsubscribe_email — unsubscribe events

Additional columns:

ColumnNotes
client_ip_addressSTRING. IP of the client.
form_fields, query_parametersSTRING. Form / URL parameters.
referrer_urlSTRING. Page that referred.
user_agentSTRING. Browser user agent.
webform_id, webpage_idINTEGER. Unsubscribe form / page ids.

activity_change_data_value — lead-attribute change events

Additional columns:

ColumnNotes
api_method_nameSTRING. API method that made the change.
modifying_userSTRING. User who made the change.
new_value, old_valueSTRING. Values before and after.
reasonSTRING. Reason for the change.
request_idSTRING. API request id.

activity_delete_lead — lead deletion events

Additional columns:

ColumnNotes
campaignSTRING. Campaign that triggered the deletion, if any.

activity_merge_leads — lead merge events

Additional columns:

ColumnNotes
merge_idsSTRING. Lead id this record was merged into.

Raw-tier query notes

When model_tier == 'raw', lifetime engagement counts on marketo__leads are not available. Compute them yourself:

  • Sends per lead: SELECT lead_id, COUNT(*) FROM activity_send_email GROUP BY 1
  • Opens per lead: SELECT lead_id, COUNT(DISTINCT id) FROM activity_open_email GROUP BY 1 (use COUNT(DISTINCT id) for unique opens or COUNT(*) for total opens)
  • Engagement rates per program: join activity_* to email_template_history.program_id (or campaign.program_id) via email_template_id (or campaign_id)
  • Funnel velocity: not directly available in raw mode — marketo__lead_history snapshots are produced by the dbt package. The closest raw signal is activity_change_data_value filtered to changes on the lead-status field (look up the field id in lead_describe).
Skills Mixer