-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] cu-865c6h9vk analytics (#3)
* Begin setup for profiling 1 * feat: profiling one and two * feat: save changes * feat: some improvements * fix: adding profiling two redirecto to router * feat: auto code review improvements * fix: changes to deploy app into staging * feat: implement zuko analytics * fix: import script for zuko * feat: changes * fix: zuko script is executed first than import zuko library * feat: only render one time * fix: change completation_event * fix: try to overwrite tailwind style over eo care page * fix: try again * build: rebuild app * feat: do changes for code review --------- Co-authored-by: urielradzyminski <62403177+urielradzyminski@users.noreply.github.com>
- Loading branch information
1 parent
ca33bc5
commit f5f9948
Showing
11 changed files
with
102 additions
and
62 deletions.
There are no files selected for viewing
54 changes: 27 additions & 27 deletions
54
apps/eo_web/dist/assets/main-a845a312.js → apps/eo_web/dist/assets/main-0a446682.js
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { useEffect } from "react"; | ||
|
||
export const useZukoAnalytic = (zukoSlugId: string) => { | ||
const triggerCompletionEvent = () => { | ||
const implementScript = document.createElement("script"); | ||
implementScript.type = "text/javascript"; | ||
implementScript.textContent = `Zuko.trackForm({slug:'${zukoSlugId}'}).trackEvent(Zuko.COMPLETION_EVENT);`; | ||
setTimeout(() => { | ||
document.body.appendChild(implementScript); | ||
}, 2000); | ||
|
||
return () => { | ||
setTimeout(() => { | ||
document.body.removeChild(implementScript); | ||
}, 2000); | ||
}; | ||
}; | ||
|
||
const triggerViewEvent = () => { | ||
const implementScript = document.createElement("script"); | ||
implementScript.type = "text/javascript"; | ||
implementScript.textContent = `Zuko.trackForm({target:document.body,slug:"${zukoSlugId}"}).trackEvent(Zuko.FORM_VIEW_EVENT);`; | ||
setTimeout(() => { | ||
document.body.appendChild(implementScript); | ||
}, 2000); | ||
|
||
return () => { | ||
setTimeout(() => { | ||
document.body.removeChild(implementScript); | ||
}, 2000); | ||
}; | ||
}; | ||
|
||
useEffect(() => { | ||
const script = document.createElement("script"); | ||
script.type = "text/javascript"; | ||
script.async = true; | ||
script.src = "https://assets.zuko.io/js/v2/client.min.js"; | ||
document.body.appendChild(script); | ||
|
||
return () => { | ||
document.body.removeChild(script); | ||
}; | ||
}, []); | ||
|
||
return { | ||
triggerCompletionEvent, | ||
triggerViewEvent, | ||
}; | ||
}; |
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 |
---|---|---|
|
@@ -52,6 +52,8 @@ | |
"Viewports", | ||
"WORKDIR", | ||
"xlink", | ||
"zustand" | ||
"zustand", | ||
"ZUKO", | ||
"Zuko" | ||
] | ||
} |
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