Hello, I have a similar issue too on the Chrome browser (mobile version) when I click the back button it only reloads the same product page and nothing happens more if I click the back button again it closes the website.
This behavior is expected, GTM4WP injects this code on every page:
<script>
const gtm4wp_is_safari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
if (gtm4wp_is_safari) {
window.addEventListener('pageshow', function(event) {
if (event.persisted) {
// if Safari loads the page from cache usually by navigating with the back button
// it creates issues with product list click tracking
// therefore GTM4WP forces the page reload in this browser
window.location.reload();
}
});
}
</script>
I am searching for a way to deactivate this behavior.
Thank you for the response, but I still have the same issue on the android chrome browser and the chrome desktop incognito mode.
But I have found out that if I disable Google Ads Remarketing tag the back button is working again. I have followed this guide and everything set as this article below: https://gtm4wp.com/how-to-articles/how-to-setup-dynamic-remarketing-in-google-ads-adwords
Hi, could you please let me know if the issue will be solved? As the remarketing tag is quite important and at the moment the website back button working only disabling this tag. Thank you.
@maxitom @floll have you already found a solution? Waiting in this little bug fix for months now…
@insidewebnl @floll Hi, at the moment I have still the same issue and I could not find the solution.
The code causing this has been removed from the GTM4WP plugin in version 1.16.2.
– check if you have updated the plugin
– check if other plugins / template code might be causing this
– check for caching
@floll @maxitom I see, however now when I click the back button it goes back to the shop/archive page and then redirects back to the product page that I was coming from.
This doesn’t happen when the GTM4WP plugin is deactivated. You can see this behavior on: https://odonna.nl (GTM4WP activated) and https://test.odonna.nl (GTM4WP deactivated).
@floll @insidewebnl Please note, now I have only issue in the chrome browser using android phone and sometimes the back button responded normally but most of the time is not working. When I pause remarketing tag, it was working without any issue.
Both of these issues seem to be unrelated to the topic of this thread: “Safari Back Button Reloading Issue”. I would suggest you create new topics for your new issues.
@floll when I disable this tag (GA4 – Event – Ecommerce events) in GTM, the issue disappears. Kinda strange, since I followed the exact steps from the guide below. This tag was automatically created by importing the GTM container.
https://gtm4wp.com/how-to-articles/how-to-setup-enhanced-ecommerce-tracking-google-analytics-4-ga4-version
@floll @insidewebnl, I’m still having the same issue, did you guys find a solution?
Yes, updating the plugin solved it for me.