-
-
Notifications
You must be signed in to change notification settings - Fork 946
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(reference): merged main & fixed conflicts
- Loading branch information
Showing
10 changed files
with
102 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,45 @@ | ||
export const trackClickForSegmentAnalytics = ({ | ||
type, | ||
clickUrl, | ||
clickText, | ||
location, | ||
userId, | ||
export const trackPageViewForSegment = ({ | ||
name, | ||
path, | ||
userExperience | ||
}) => { | ||
if (window.analytics) { | ||
window.analytics.track(`CTA ${type} Clicked`, { | ||
...(clickUrl && { click_url: clickUrl }), | ||
...(clickText && { click_text: clickText }), | ||
...(location && { location }), | ||
...(userId && { user_id: userId }), | ||
window.analytics.page("Page viewed", name, { | ||
...(path && { path: path }), | ||
...(userExperience && { user_experience: userExperience }) | ||
}); | ||
} | ||
}; | ||
|
||
export const trackPageForSegmentAnalytics = ({ name, path, userId }) => { | ||
export const trackClickForSegment = ({ | ||
eventName, | ||
clickType, | ||
userExperience, | ||
responseStatus, | ||
responseMsg, | ||
timestamp, | ||
}) => { | ||
if (window.analytics) { | ||
window.analytics.page("Page view", name, { | ||
...(path && { path: path }), | ||
...(userId && { userId: userId }), | ||
window.analytics.track(`CTA ${clickType} Clicked`, { | ||
...(eventName && { event_name: eventName }), | ||
...(userExperience && { user_experience: userExperience }), | ||
...(responseStatus && { response_status: responseStatus }), | ||
...(responseMsg && { response_msg: responseMsg }), | ||
...(timestamp && { timestamp: timestamp }), | ||
}); | ||
} | ||
}; | ||
|
||
export const trackInputChangeForSegment = ({ | ||
eventName, | ||
userExperience, | ||
timestamp, | ||
}) => { | ||
if (window.analytics) { | ||
window.analytics.track(`Input changed`, { | ||
...(eventName && { event_name: eventName }), | ||
...(userExperience && { user_experience: userExperience }), | ||
...(timestamp && { timestamp: timestamp }), | ||
}); | ||
} | ||
}; |