Comments (4)
Yeah, this was dropped in favor of using the client.url()
method and internal resources config for building URLs. The issue was that this writePath
design made it super difficult to customize the URL when proxying writes through an intermediary service. I suppose this wording should be removed from the README file. Nice catch!
from keen-tracking.js.
What's the recommended way to achieve "writepath" like features?
We're proxying writes through our own server, and it doesn't use the /3.0/projects/... url format.
So to override the path I am doing this very hacky thing
var writePath = "/api/analytics/events"; // our custom prefix
client.config.resources.events = client.config.resources.events.replace("/3.0/projects/{projectId}/events", writePath);
from keen-tracking.js.
@Ramblurr these resources are managed via the internal resources
map you found, and can be accessed w/ the client.resources()
method. This map is used to construct URLs with client.url('some-key')
. We've named the defaults according to corresponding API resources.
Here are a few examples:
{
'projectId': '{protocol}://{host}/3.0/projects/{projectId}',
'events': '{protocol}://{host}/3.0/projects/{projectId}/events'
}
Those values wrapped in brackets are replaced with matching props from the client instance's configuration. This is all meant to create some options with regard to building out URLs.
You can rewire (and then access) the events
endpoint like so:
client.resources({
'events': '{protocol}://{host}/api/analytics/events'
});
client.url('events');
// returns https://your-host.com/api/analytics/events
You could also just hardwire the protocol and host in this way too, if you prefer.
Does this help answer the question? Sorry for the speed-bump!
from keen-tracking.js.
@Ramblurr was this answer helpful? Closing for now, but please let me know if I can add any more info or context here-
from keen-tracking.js.
Related Issues (20)
- respect navigator.donottrack HOT 1
- new defaults for v5
- autocollector - on click - add exact mouse/touch x, y values
- tracking of the form fields - bounce rates
- add more mobile device-related info to the events in Autocollector
- Client-side CORB Warning HOT 9
- Script throws an exception if localStorage is disabled HOT 2
- remove fetch polyfill HOT 2
- remove promise polyfill
- Cross Origin Read Blocked For Beacon API HOT 1
- send form fields on form submission
- Loading the tracker triggers a forced layout
- return responce.created
- Packaging Issue with 4.5.1 HOT 2
- Add way to define custom headers to extendEvents()
- Changelog is missing for 5.0 HOT 3
- Keen tracking on server side is not reusing connections
- serializeForm breaks form when submit is named HOT 4
- Is this project still maintained?
- Local community event tracker
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 keen-tracking.js.