By default when a user logs in GHL, he is sent to "/dashboard" by default. But I want the user to redirect to Contacts page instead –> "contacts/smart_list/All". GHL allows custom JavaScript, so I came up with the following script:
But it only works if I am on the "/dashboard" page already and refresh it manually.
I want this to work right after the user logs in and when dashboard is loading, the script should be loaded and do its work and redirects the user to "contacts/smart_list/All" page instead.
I know this is possible as other people have done it, but I don’t know what I am doing wrong.
<script> if (window.location.href.match("location/xkTaFgTklXH0jB/dashboard")) { window.location = "https://app.gohighlevel.com/v2/location/xkTaFgTklXH0jB/contacts/smart_list/All"; } </script>
2
Answers
You can do like this:
Your provided script is comparing if current url is dashborad then only redirect to contacts/smart_list/All url
But your requirement is something like you have to add script to login page which will check the user is sinned in or not
If Signed-In success then redirect to the https://app.gohighlevel.com/v2/location/xkTaFgTklXH0jB/contacts/smart_list/All
That’s it.