This is my code snippet:
function MobileDealLink(pURL) {
if (document.documentElement.clientWidth < 501 && pURL != '0') {
window.location=pURL;
}
}
What happens is,if a user presses a div that is calling this function, that particular user is successfully redirected to that link. But when he presses the back button on his device, he is sent to the page prior to visiting the page that ran the function.
Here's the actual scenario:
- User googles for property; enters website through Google results page
- Sees property listings on homepage of website, and presses a specific property listing div
- Div onclick runs function, sends user to full listing page of specific property
- User now presses the back button on his device (wishing to go back to the website homepage)
- Device sends user back to Google and not back to homepage (This is the baffling issue I'm facing.)
How do I stop this happening? I believe this is greatly affecting the bounce rate of the website by throwing the visitor straight back to Google instead of going back to the homepage and assisting in a "textbook style sales funnel" experience.
*You can witness this for yourself on the website: https://www.propertypost.lk