After submitting the form, the page does not redirect. It simply stays on the same page, and the default Contact Form 7 success message appears. The dataLayer.push event seems to be working as expected, but the redirect (location.replace) is not happening.
Could you please advise if there's anything else I need to configure within the TheGem theme or WordPress settings to allow this JavaScript redirect to work, or if there's a better/recommended way to achieve this with TheGem?
Unfortunately, the theme doesn't have such functionality and the theme should not affect the operation of this code. Where exactly did you get this code?
After submitting the form, the page does not redirect. It simply stays on the same page, and the default Contact Form 7 success message appears. The dataLayer.push event seems to be working as expected, but the redirect (location.replace) is not happening.
Could you please advise if there's anything else I need to configure within the TheGem theme or WordPress settings to allow this JavaScript redirect to work, or if there's a better/recommended way to achieve this with TheGem?
Thank you for your help!
DanielĀ
Attached files: JS Code .jpg
Hi,
Unfortunately, the theme doesn't have such functionality and the theme should not affect the operation of this code. Where exactly did you get this code?