feat: Add meta pixel conversion events#25638
Conversation
|
@roy-abir05 is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
d23843c to
aead0c5
Compare
dhairyashiil
left a comment
There was a problem hiding this comment.
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 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 2025-12-12.12-45-15.mp4The 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. |
|
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! |
aead0c5 to
ad447b9
Compare
ad447b9 to
c2c95a0
Compare
|
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. |
|
@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. |
c2c95a0 to
e6dbce2
Compare
|
Hi @anikdhabal, Thanks for updating the branch. It looks like the CI/CD workflows are stuck on Thanks! |
481f7d8 to
13f09e3
Compare
|
@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. |
|
Hi @sahitya-chandra! All CI checks are fixed and fully green now. The type checks, production builds, and all E2E test suites passed successfully. Thanks again for the help. |
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
PageViewevent on the booking success page. This update allows users to select a specific event type (Lead(default),Schedule,Complete Registration, orPage 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:
Booking Confirmed Page:
Mandatory Tasks (DO NOT REMOVE)
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
Scheduleor any other event of your choice from the newConversion Eventdropdown, and clickSaveBooking Test: Go to a public booking page and complete a booking.
Verification:
trPageViewandCalcomViewevents are fired.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 (onlyPageViewandCalcomViewshould fire).SPA Test: Verify the event fires immediately upon transition to the success page without requiring a hard browser refresh.
Checklist