---
title: PaperTube ABM Lead Engagement Notifications via Apex
type: article
created: '2026-03-13'
updated: '2026-03-13'
source_docs:
- raw/2026-03-13-weekly-call-w-karly-129884582.md
tags:
- salesforce
- apex
- abm
- pardot
- account-engagement
- papertube
- lead-attribution
- email-automation
layer: 2
client_source: null
industry_context: null
transferable: true
---

# PaperTube ABM Lead Engagement Notifications via Apex

## Overview

PaperTube's ABM system runs a custom Apex-based email orchestrator that sends personalized outreach emails through the Pardot API. To help the client identify when to personally follow up with prospects, an Apex script was deployed to send real-time email alerts when contacts show meaningful engagement signals.

This is distinct from Account Engagement (Pardot) automations — the notification logic is custom Apex that hooks into the existing engagement sync, not a native Pardot automation rule.

## Architecture Context

The PaperTube ABM system works as follows:

1. **Email Scheduler (9 AM)** — Queries scheduled ABM email records and sends them in batches via the Pardot Send Endpoint.
2. **Engagement Sync (11 AM)** — Calls the Pardot Visitor Activity API to pull open and click data, then updates fields on ABM email records in Salesforce.
3. **Notification Layer** — The new Apex logic hooks into the engagement sync to detect qualifying engagement events and fires email alerts to the client.

Email content is stored in a Supabase database and assembled on the fly by Apex, allowing each contact to receive a fully customized message — something Account Engagement cannot do natively.

## Engagement Notification Triggers

The deployed Apex script sends an alert to the client (Parag) when either of the following conditions is met at the contact level:

| Trigger | Condition |
|---|---|
| **Link Click** | Any link click in an ABM email — always notified, regardless of open count |
| **Repeated Opens** | 3 or more email opens within a rolling 60-day window |

The intent is to surface contacts who are showing genuine interest so the client can initiate a personal outreach rather than relying solely on the automated sequence.

## Implementation Notes

- The script **modifies the existing engagement sync** rather than creating a separate job. It detects new qualifying events during the 11 AM sync run.
- Click detection uses a **bot-click filter**: any click recorded within ~15 seconds of delivery is discarded as a likely security scanner/firewall bot and not counted toward the trigger threshold. This methodology was developed after observing inflated click rates on the Aviary account.
- Notifications are sent to the client via Salesforce Messaging (email) using Parag's user ID.
- A technical documentation file (`ABM-Engagement-Docs`) was generated and shared with the client alongside a plain-language summary email explaining what the system does.

## Related Work Deployed in the Same Session

### Lead Source Attribution Fix

Leads arriving from the `PaperTube.pro` domain were incorrectly attributed to "Google AdWords" or "Hunter.io" due to how the UTM source field was being mapped. A Salesforce automation was deployed to set the **Lead Source** field to "Asymmetric" for any lead or contact where the UTM source contains `papertube.pro` (wildcard match).

- The fix applies to both new inbound leads and existing ABM contacts loaded via Hunter.io.
- Lead Source is a global picklist field shared between the Lead and Contact objects; "Asymmetric" was already present as a valid picklist value.
- A separate field — **Account Lead Source** — was identified as missing at the Account object level. A sync from Contact Lead Source to Account was scoped as a follow-up task.

### ABM Performance Reports

Four new Salesforce reports were created in the "Asymmetric ABM" reports folder:

- New Leads
- Lead Conversions
- Open Opportunities
- Closed Opportunities

An issue was identified where reports defaulted to **"My Leads"** scope, causing them to appear empty. Scope was changed to **"Organization"** to surface all relevant records. A backfill was initiated to populate historical data.

## Action Items (from this session)

- [ ] **Mark** — Create `Contact Stage` field in Salesforce (MQL / SQL / Opportunity lifecycle tracking)
- [ ] **Mark** — Create `Account Lead Source` field and sync from Contact Lead Source
- [ ] **Mark** — Monitor "Asymmetric Activity" reports and dashboard after backfill completes
- [ ] **Karly** — Email Parag re: new engagement notification system; attach the technical doc link

## Related Articles

- [[wiki/clients/papertube/_index]]
- [[wiki/knowledge/salesforce/papertube-abm-secondary-contact-nurture]]
- [[wiki/knowledge/salesforce/lead-source-attribution-automation]]
- [[wiki/meetings/2026-03-13-weekly-call-karly-papertube-quora]]