Skip to content

Commit

Permalink
hacky way to inject email into intercom settings
Browse files Browse the repository at this point in the history
  • Loading branch information
darragh committed Dec 4, 2024
1 parent 556b2d2 commit a971f88
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions fin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,24 @@

<script>
window.intercomSettings = {
api_base: "https://api-iam.intercom.io",
app_id: "pef3qizw",
api_base: "https://api-iam.intercom.io",
app_id: "pef3qizw"
};
</script>

const allowedQueryParams = ['user_id', 'email'];

function setIntercomParamsFromURL(allowedParams) {
const urlParams = new URLSearchParams(window.location.search);

allowedParams.forEach(param => {
const value = urlParams.get(param);
if (value) {
window.intercomSettings[param] = value;
}
});
}
setIntercomParamsFromURL(allowedQueryParams);
</script>


<script>
Expand Down

0 comments on commit a971f88

Please sign in to comment.