Post with query params is getting redirected


#1

Hello! I am wondering if people have any thoughts on how to best add url params t for gAnalytics to links to Ghost posts, for example

https://myghostblog.net/a-post/?utm_term=example

This doesn’t seem to work consistently, I see that Ghost sends a 301, redirects to the page w/o the query string, and then sends a 304 and redirects to itself.

https://myghostblog.net/a-post?utm_term=example

This seems even worse, it’s 301, 301, 304.

https://myghostblog.net/a-post/index.html?utm_term=example

Just a 404.

Is there some better way? Thanks!


#2

I see this seems to be specifically fallout from Dynamic Routing[1], I rolled our blog back to 1.23.1 and everything works again. I guess I will log that…

1: https://github.com/TryGhost/Ghost/pull/9596


#3

Hey! Thanks for the report. I can confirm this bug was introduced in 1.24.0.

1.24.1 is on the way. Could you please re-test the behaviour as soon as 1.24.1 was released?
That would be very helpful. I’ll leave a message as soon as it’s out :slight_smile:

https://myghostblog.net/a-post/index.html?utm_term=example

FYI: This didn’t work < 1.24.0.


#4

We’ve just released 1.24.1.


#5

Excellent! I can confirm it’s working as expected in 1.24.1 - thanks for the hustle!
-T.


#6