-
Notifications
You must be signed in to change notification settings - Fork 7.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add framework to send all events fired for embed to Analytics Apps #15173
feat: Add framework to send all events fired for embed to Analytics Apps #15173
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Ignored Deployments
|
Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link. |
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @hariombalhara and the rest of your teammates on Graphite |
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
78f8074
to
3e64d6c
Compare
|
||
import type { appDataSchemas } from "./apps.schemas.generated"; | ||
|
||
const PushEventPrefix = "cal_analytics_app_"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A global function is defined starting with this string for each analytics app.
3e64d6c
to
6a0142d
Compare
startTime: string; | ||
endTime: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The response of a regular fetch request can't have Date as value for any prop, so we accordingly adjust the types.
@@ -2253,7 +2253,7 @@ async function handler( | |||
req.statusCode = 201; | |||
// TODO: Refactor better so this booking object is not passed | |||
// all around and instead the individual fields are sent as args. | |||
const bookingReponse = { | |||
const bookingResponse = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo fix.
@@ -1636,8 +1636,8 @@ async function handler( | |||
...newBooking.user, | |||
email: null, | |||
}, | |||
paymentRequired: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this prop to easily differentiate the case where payment is required.
6a0142d
to
b3f3140
Compare
b3f3140
to
d48815d
Compare
d48815d
to
ca98c6d
Compare
ca98c6d
to
b67dad6
Compare
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (05/30/24)1 reviewer was added to this PR based on Keith Williams's automation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good 🙏
…pps (calcom#15173) * Send all events to analytics apps * feat: Start sending all events fired for embed to Analytics Apps(GTM Support added) * Add tests
What does this PR do?
Now, we can simply add the support of pushing any event to any analytics app by defining a
pushEventScript
prop in config.json. This would work for any analytics app that support sending an event with any payload.Any event fired through
sdkActionManager.fire
call will reach the enabled analytic app if it haspushEventScript
prop definedpushEvent
bookingSuccessfulV2
andrescheduleBookingSuccessfulV2
. Also, deprecatedbookingSuccessful
andrescheduleBookingSuccessful
Fixes #15168
Fixes CAL-3785
GTM dataLayer event demo
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
NOTE:
For apps like fathom which just supports
_value
as an event prop and recommends event name to be dynamic as well, GTM(or some other tag manager) is better suited to listen to the event and send that specific event based on the dataLayer variables.