Sync new Wistia video leads to HubSpot and Google Sheets

By General Input

Every hour, pull fresh email captures from your Wistia videos into HubSpot and a shared Google Sheet so your sales team has one source of truth.

Integrations

  • Wistia
  • HubSpot
  • Google Sheets

Type

Deterministic Code

Categories

  • Sales
  • Operations

Every hour, sync any new Wistia Turnstile email captures from my videos into HubSpot and a Google Sheet so my sales team has a single source of truth for video-sourced leads. This should run as a deterministic code workflow on an hourly cron trigger.

Step 1: Call Wistia's List Medias operation to enumerate the active videos on my account. Page through results so the workflow covers every video, not just the first page.

Step 2: For each video, call Wistia's Get Media Analytics Conversions operation with a date range covering roughly the last hour (use a small overlap window, like the last 70 minutes, to avoid dropping leads between runs). Pull the email, the video that was viewed, the timestamp, and percent watched if available.

Step 3: Dedupe the conversions by email plus video hashed ID across the batch, then shape each row into a HubSpot contact payload. Set the email, set a custom property called wistia_source_video to the video title, and set lifecycle stage to lead. Then call HubSpot's Batch Upsert Contacts operation matched by email so existing contacts get updated and new ones get created.

Step 4: For each new lead from this run, append one row to a Google Sheet using Google Sheets' Append Values operation. Columns: timestamp, email, video title, video URL, percent watched. The sheet ID and tab name should be configurable.

If any individual video's conversions call fails, log the error and continue with the rest so a single bad video does not block the whole sync. At the end, return a small summary with counts: videos scanned, new leads upserted to HubSpot, rows appended to the sheet.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageLet support send one-off Loops emails without an engineerTurn Mailjet email clicks into ranked HubSpot follow-upsStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardA searchable RFP answer library your bid team drafts fromLinkedIn Ads budget pacing dashboard for every client accountSee which target accounts just started advertising on LinkedInFront desk appointment confirmation board for the next 3 days