Go to Settings in your site's dashboard
Click the Tracking & Analytics tab under Advanced Settings
Click + New Tool and select Custom
Choose if you need to run the redirect on all pages or selected pages
Ensure you select 'Load code on each new page'
Ensure you select 'Place code in - Head'
More information regarding adding Custom scripts in WIX can be found here