An easy way to proxy analytics script on LiteSpeed webservers. #1974
Replies: 6 comments 6 replies
-
thanks for the feedback @oldrup! i just checked and seems to be working all fine. my ublock origin doesn't catch it. i can still see a call to data-api='https://plausible.io/api/event and our instructions proxy that call too but adblockers don't seem to be touching it in this case. |
Beta Was this translation helpful? Give feedback.
-
I had a little trouble with this, in that tracking appeared to stop immediately after activiating LS Cache localisation. I noticed I couldn't see the call to data-api="https://plausible.io/api/event", but then it wasn't in my script src:
I manually added added data-api, and all is well and recording properly
|
Beta Was this translation helpful? Give feedback.
-
That's correct, I try to keep my use of plugins to a minimum so used the script info provided within plausible settings: LS Cache picks this up fine, but as I said I needed to take the additional step of adding |
Beta Was this translation helpful? Give feedback.
-
This looks like to not be working anymore which is unfortunate, not exactly sure when it did stop. |
Beta Was this translation helpful? Give feedback.
-
@oldrup How did you manage to setup a reverse proxy in Litespeed? I can't seem to get it to work. |
Beta Was this translation helpful? Give feedback.
-
Thanks for replying @oldrup, even though this is an old thread. Actually, I'm running a VPS (not shared hosting, as mentioned here) and had trouble setting up a reverse proxy in OLS with my PA docker installation. My configuration kept giving errors. But I think I finally got it work. Hence my asking. Running PA locally is also something I want to do. Although I'm not quite sure if I understand the whole thing yet. My setup Or does localization mean to take the script ( |
Beta Was this translation helpful? Give feedback.
-
Hey
Just wanted to share what I believe is the easiest way to "proxy the script for analytics" when using LiteSpeed webservers, which are super common on the WordPress hosts I'm using..
In the Litespeed > Page Optimization menu, there is a rather new tab called "Localize Resources".
Just enter the url for the tracking script, flush the cache, and off you go..
More info on the feature is available here: https://docs.litespeedtech.com/lscache/lscwp/pageopt/#localize-resources
Here's how the script is server from my domain (dev console, network tab)
My Adblocker (ublock origin) no longer has anything to block.
I tested that visits are actually being tracked, in Firefox and Edge.
Method currently being tested on https://oldrup.net/ - but I'll implement it on my other sites anytime.
Of course inspired by the article at https://plausible.io/docs/proxy/introduction
Will happily provide prettier screenshots for documentation, if someone verifies this approach as working great.
Bjarne
Beta Was this translation helpful? Give feedback.
All reactions