1

I have an image slider on my website. The entire slide is a link. I created a web page just to have a URL to use for a 301 redirect.

Slide links to website.com/sample-page > Redirect is set to instagram.com/companyname.

I tried setting up a Page View in Google Tag manager, but it was not registering in Google Analytics. So then I tried setting the page view up as an event. Still not registering in Google Tag Manager.

Is is possible that even though the website URL is clicked on, GTM is not registering anything since the 301 redirect kicks in?

1 Answer 1

2

Google tag manager and Google Analytics can't run on redirect URLs.

When a browser hits a redirect URL, it only uses the HTTP headers. It looks at the Location: header to figure out where the redirect is going. It doesn't use any of the HTML or JavaScript that comes in the body of the response. Your server isn't going to even include your GTM or GA snippets in the redirect response body.

A 301 redirect will be tracked in your server logs. You can use your existing setup to see how many clicks you are getting if you can gather that information from your log files rather than from GA.

If you want to track the clicks using GTM and GA, you need to do so on the page that contains the link. GTM can be configured to insert a tag onto the link and wait for up to a couple seconds after it is clicked so that it can be tracked. Full instructions can be found here: https://www.analyticsmania.com/post/track-outbound-links-with-google-tag-manager/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.