Skip to content

feat: Add meta pixel conversion events#25638

Merged
sahitya-chandra merged 9 commits intocalcom:mainfrom
roy-abir05:feat/meta-pixel-conversion-events
Feb 19, 2026
Merged

feat: Add meta pixel conversion events#25638
sahitya-chandra merged 9 commits intocalcom:mainfrom
roy-abir05:feat/meta-pixel-conversion-events

Conversation

@roy-abir05
Copy link
Contributor

@roy-abir05 roy-abir05 commented Dec 5, 2025

What does this PR do?

This PR adds the ability to configure specific Standard Conversion Events for the Meta Pixel integration.

Previously, the app only fired a generic PageView event on the booking success page. This update allows users to select a specific event type (Lead (default), Schedule, Complete Registration, or Page View) from the app settings. This ensures that the correct signal is sent to Meta for better ad optimization and reporting.

Additionally, this PR implements a robust History API hook to ensure conversion events fire correctly during client-side navigation (SPA transitions) in Next.js, while preventing duplicate events on page refreshes.

It also excludes "Cancellation" pages for firing the conversion events.

Visual Demo

Video Demo:

2025-12-05.15-57-59.mp4

Image Demo:

Booking Form Page:

Screenshot 2025-12-05 16-02-02

Booking Confirmed Page:

Screenshot 2025-12-05 16-01-21

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code.
  • N/A
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Setup: Install the Meta Pixel app and enter a dummy Pixel ID (e.g., 123456789).

  • Configuration: Go to App Settings, select Schedule or any other event of your choice from the new Conversion Event dropdown, and click Save

  • Booking Test: Go to a public booking page and complete a booking.

  • Verification:

    • Open Chrome DevTools > Network Tab (Ensure "Preserve Log" is enabled).
    • Filter by tr
    • Verify that on the booking form, PageView and CalcomView events are fired.
    • Verify that upon reaching the success page, a request with payload ev: Schedule (or the event that you selected) is fired instantly.
  • Cancellation Test: Click "Cancel Booking" on the success page. Verify that the conversion event (Schedule) does not fire on the cancellation confirmation page (only PageView and CalcomView should fire).

  • SPA Test: Verify the event fires immediately upon transition to the success page without requiring a hard browser refresh.

Checklist

  • I have read the contributing guide
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have checked if my changes generate no new warnings

Open with Devin

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Dec 5, 2025
@github-actions github-actions bot added the 🐛 bug Something isn't working label Dec 5, 2025
@vercel
Copy link

vercel bot commented Dec 5, 2025

@roy-abir05 is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

@roy-abir05 roy-abir05 force-pushed the feat/meta-pixel-conversion-events branch from d23843c to aead0c5 Compare December 11, 2025 11:46
Copy link
Member

@dhairyashiil dhairyashiil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR and the after video. Could you please attach the before video as well? I haven’t worked on this part before, so I’m not familiar with the current behavior.
A description with an example would also be helpful. Please add both, and I’ll review it afterward. Thanks!

@dhairyashiil dhairyashiil marked this pull request as draft December 11, 2025 19:54
@roy-abir05
Copy link
Contributor Author

roy-abir05 commented Dec 12, 2025

Thank you for the PR and the after video. Could you please attach the before video as well? I haven’t worked on this part before, so I’m not familiar with the current behavior. A description with an example would also be helpful. Please add both, and I’ll review it afterward. Thanks!

Thanks for the review!

The Context: Currently, the Meta Pixel app fires a generic PageView event on the Booking Success page. This prevents advertisers from distinguishing between a user simply visiting a booking page vs. actually completing a booking. Without a distinct conversion event (like Lead or Schedule), ad campaigns cannot be optimized for conversions.

The "Before" Behavior: As you can see in the recording below, the App Settings has no configuration options. When a booking is completed, the Network tab shows only a PageView event firing.

2025-12-12.12-45-15.mp4

The Fix: This PR adds a dropdown to select a specific Standard Event (e.g., Schedule) and implements a History API hook to ensure this event fires correctly on the client-side transition to the success page.

@roy-abir05 roy-abir05 marked this pull request as ready for review December 12, 2025 07:27
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

@roy-abir05
Copy link
Contributor Author

Hi @dhairyashiil,

Just checking in—did the Before video and explanation above provide the context you needed?

Please let me know if any changes are required. I am happy to provide more details if needed. Thanks!

@roy-abir05 roy-abir05 force-pushed the feat/meta-pixel-conversion-events branch from aead0c5 to ad447b9 Compare December 18, 2025 16:12
@roy-abir05 roy-abir05 force-pushed the feat/meta-pixel-conversion-events branch from ad447b9 to c2c95a0 Compare January 5, 2026 16:02
@github-actions
Copy link
Contributor

This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active.

@github-actions github-actions bot added the Stale label Jan 14, 2026
@devin-ai-integration devin-ai-integration bot added the Medium priority Created by Linear-GitHub Sync label Jan 19, 2026
@roy-abir05
Copy link
Contributor Author

@dhairyashiil Just bumping this to keep it open. The branch is up-to-date and I believe I've addressed the previous feedback regarding the Before video.

Let me know if there is anything else needed to get this merged.

@roy-abir05 roy-abir05 force-pushed the feat/meta-pixel-conversion-events branch from c2c95a0 to e6dbce2 Compare January 19, 2026 11:57
@roy-abir05
Copy link
Contributor Author

Hi @anikdhabal,

Thanks for updating the branch.

It looks like the CI/CD workflows are stuck on Authorization required, so the tests were skipped. Could you please authorize the deployment so we can get a green build?

Thanks!

@roy-abir05 roy-abir05 force-pushed the feat/meta-pixel-conversion-events branch from 481f7d8 to 13f09e3 Compare February 2, 2026 13:16
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

Copy link
Member

@sahitya-chandra sahitya-chandra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sahitya-chandra sahitya-chandra added ready-for-e2e run-ci Approve CI to run for external contributors labels Feb 19, 2026
@sahitya-chandra
Copy link
Member

@roy-abir05 are you still working on this?

@roy-abir05
Copy link
Contributor Author

@roy-abir05 are you still working on this?

Hi @sahitya-chandra ! Yes, I am still here and monitoring this.

Thanks for the review, the LGTM, and for cleaning up that file. I noticed the CI failed on the check-types step because the new trackingEvent field was throwing errors on legacy database objects. I just changed .default("Lead") to .optional() in the Zod schema (the fallback to 'Lead' is already safely handled in the app data getter).

Standing by for the E2E tests.
Thanks for helping me get this across the finish line

@sahitya-chandra sahitya-chandra added run-ci Approve CI to run for external contributors and removed run-ci Approve CI to run for external contributors labels Feb 19, 2026
@roy-abir05
Copy link
Contributor Author

Hi @sahitya-chandra!

All CI checks are fixed and fully green now.

The type checks, production builds, and all E2E test suites passed successfully.
Let me know if there's anything else needed.

Thanks again for the help.

@sahitya-chandra sahitya-chandra merged commit 12e95a1 into calcom:main Feb 19, 2026
67 of 70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working community Created by Linear-GitHub Sync Medium priority Created by Linear-GitHub Sync ready-for-e2e run-ci Approve CI to run for external contributors size/M Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Meta Pixel app: Add support for Lead/CompleteRegistration conversion events on booking confirmation

3 participants