Comments (3)
I probably don't need to tell that it's highly unethical for you to track your users/customers if they specifically have opted out of tracking with e.g. using an ad blocker?
Good! Now, with that aside it is very possible to do this with ga-lite.
There are two options to do this:
1. Override _sendTo
method of the tracker
This can be done with the normal build of ga-lite. The tracker calls a method called _sendTo
every time it wants to send an analytics event. You can easily change the URL there.
Here's an example from the ga-lite's own test suite that does exactly what you're trying to accomplish.
2. Build ga-lite yourself
You can clone this project, change the base URL to whatever you like, and build the source to your own version of ga-lite.
This allows you also to remove the doNotTrack
check from the beginning of you want to maximize the amount of tracking done for your users.
from ga-lite.
Thank you for the clearly detailed response! I'm aware of the ethical concerns, I use adblockers myself and I plan to respect the "Do not track" browser setting.
On your proposed options, I wasn't aware you could override the method like that, so I think that will do for now. I'll check it out and report any issues.
from ga-lite.
I'll close this issue for now, let me know if you have any other issues :)
from ga-lite.
Related Issues (20)
- Support for the new Google Analytics 4 tag HOT 9
- Use keepalive flag with fetch
- Capture ga() function calls and re-route them through galite() HOT 5
- Add note to README about using preconnect/preload to improve google page speed HOT 7
- ESM version for modern browsers HOT 10
- Universal Analytics (GA3) and GA4 same time HOT 2
- Illegal Invocation error due to lack of navigator.sendBeacon binding HOT 1
- Self Referral Traffic
- NPM bundle not including commands directory HOT 1
- Customizable endpoint URL and User Language HOT 2
- Instructions on using esm version to readme HOT 4
- SyntaxError Unexpected token = HOT 2
- Yarn run build not working HOT 4
- XMLHttpRequest on main thread is deprecated HOT 2
- Are Conversion Tags Possible & Phone Number Tags HOT 4
- Disableing of ga-lite through cookie HOT 4
- SSR issue introduced HOT 5
- It should be mentioned that ga-lite doesn't use cookies HOT 3
- Stop working on Chrome 85+ for somehow HOT 6
- Test coverage for SSR / node.js compatibility HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ga-lite.