Google Analytics link returning 404

  • 1
  • Problem
  • Updated 2 years ago
  • Not a Problem
  • (Edited)
An image and button linked to a news article and function properly in the preview. After receiving the email in Outlook and Gmail and clicking on either the image or button it returned the error "400 - Bad Request". It seems like the tracking pixels that were added to the URL are the problem. Here is the full URL:
Photo of MJ Freeway

MJ Freeway

  • 6 Posts
  • 0 Reply Likes

Posted 2 years ago

  • 1
Photo of Sam Collis

Sam Collis, Customer Support Specialist

  • 252 Posts
  • 59 Reply Likes
Hi there,

I think I can shed some light as to why that particular link was returning a 404 error when the Google Analytics appendages were added to the URL.

I ran a few tests on that URL using the Google Analyics URL builder tool which is a great place to determine where a breakdown lies.  In this case I added in the URL and used default tags to simulate the creation of that URL you posted.  I found that it worked until I added the Campaign Content which is pulled from the Alternate text of the image.

What I found was that the spacing in that name was breaking the link.  I tried with a seperate page from with the same results.  It wasn't until I removed all the spaces from the Campaign Content that I was able to bypass that 404 error.  After this I tested the same Campaign Content with a different random URL that wasn't and received no 404 error.

Basically, some server environments don’t allow the URL extension parameters like Analytics uses to identify your user and will throw out the 404 error.  In this instance it seems that the does not allow spaces in the URL (which are represented by "%20").

I can see that you already sent that mailing out without GA attached, my apologies we weren't able to get in touch before that, but I guess moving forward if you run into trouble with your links being broken, the URL builder is a great way to see where the breakage is occurring.

I hope that sheds some light on why that link was breaking and please don't hesitate to let me know if you have any further questions :)

- Sam

P.S I changed the title of the post so that others running into something similar might find it.