Ignoring gclid and utm tags #382
-
Hi Guys I'm a happy user of laravel-responsecache, but I've noticed that all my visitors from AdWords rarely see the cached versions of my site - likely due to the appended ?gclid=XXXXX or ?utm_source=XXXX URL parameters. Since these URL parameters do not have any impact on how the page should be displayed (in my case) nor need to be sent to any laravel controller, I'm wondering if it would be possible to ignore these tags and show the cached version of my page saved To be clear, what I want to achieve is this: I have a page https://example.com/page which is cached using laravel-responsecache and I'd like to display the cached page when a user visits https://example.com/page?gclid=* I'm wondering if anyone has had luck with this or could point me in the right direction? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
I think you can 301 redirect to the original url after they click on the ad, and that way the cache will be used. |
Beta Was this translation helpful? Give feedback.
-
@mthorsdal did you found any solution for this? |
Beta Was this translation helpful? Give feedback.
-
I think you should take a look at DefaultHasher
Register hasher in config file |
Beta Was this translation helpful? Give feedback.
-
That did the job, thanks! In my case, I wanted to exclude tracking parameters, so I used
|
Beta Was this translation helpful? Give feedback.
I think you should take a look at
DefaultHasher
class and implement a custom Hasher to serve your purpose. The issue lies in the fact that the DefaultHasher by the package use the whole query string as part of the hash. You should do some stuff to remove out all unnecessary query string (gclid= or utm_source=). Also, remember to change the Hasher in the config file. I will try it out myself if I had the time.DefaultHasher
Register hasher in conf…