New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide read-only access to some properties generated inside tracker object #548
Comments
Nice idea, scheduling... |
Our need for this has to do with click tracking. Currently we have our own click redirect and also have been using the javascript link tracking built into the javascript tracker. We have our script deployed across a wide variety of client sites. We wanted to see whether the javascript tracker was counting as many clicks as our redirect so as a sanity check we took click count samples over multiple days from both our redirect and also from the snowplow reported clicks. On some sites they were close, and on other sites either our redirect had a much larger count of clicks than snowplow and on others it was the reverse. The discrepancy was consistent for the same site across multiple days, so timezones/timestamp differences between our redirect and snowplow could not explain the difference. It appears in some cases a redirect does a better job and in other cases the client-side javascript does a better job. Not sure why, my best guess is that it might have to do with other tracking scripts that the client might be running on their site. Since we want to get the most complete count of clicks, our solution is to (a) continue tracking clicks from the javascript tracker and (b) use the clojure collector as a redirect and (c) rely on our data modeling scripts to deduplicate the clicks that appear in both. We planned on using the web_page.id (pageViewId) and the link target URL as the key for deduplication (we only need to track unique clicks, don't need to be able to count multiple clicks on the same URL for the same page view). The problem we ran into was that, while the link_click event from the javascript tracker will append the web_page context automatically, we will need to manually add it to the click URL so that the redirect can pick it up as a context. Since we can't get this ID as a getter-function, we are stuck. Hopefully that provides more context. Do you have plans in the short-term to deliver this getter-function for the web_page context id? If not, it sounds like something that we could implement ourselves and submit a pull-request. It would be helpful though if you could point us to the right part of the code to make this change. |
Moving forwards to 2.8.0 |
The shortlist of things to expose seems to be:
Are there any others I'm missing / someone wants to add? |
Ping @yalisassoon @bogaert |
Nothing comes to mind. |
A bit late to the party but session variables like Also, users can have an option to archive The latter is a whole separate conversation but having FWIW, this was awesome in 2.2.0: snowplow(function () {
// Get the fingerprint which the tracker
// generates based on browser features
var userFingerprint = this.cf.getUserFingerprint();
// Get the ID stored in the first party cookie
var domainUserId = this.cf.getDomainUserId();
// Get all information stored in the first party cookie
var domainUserInfo = this.cf.getDomainUserInfo();
// Get the ID which you set for the user
var businessUserId = this.cf.getUserId();
doSomethingWith(userFingerprint, domainUserId);
}); |
So add access to the |
Yes. |
Okay let's go for it, it can't hurt... |
Renamed to reflect that the discussion regarding other internal properties that need exposing should happen here. |
Hey, did this ever get anywhere? |
Just real quick: we'd love to have programmatic access to the session ID as well. Use case: We're tracking server sided events, (i.e. Login within our Login API, clickout through our click tracker) and want to attribute those server sided events to the correct app session. For this, we need to extract the session and propagate it to the backing services. Currently, would be possible to access the session ID through the cookie, but that would be super hacky (especially since the tracker manages its own storage that might also be localStorage or something else). Do you see problems with this? |
I don't see any problems - @chuwy @BenFradet ? |
me neither, moved the discussion to #610 |
From the comments it looks like this should have been closed a while ago, all of the discussed features have existed since around 2.8.0. |
Recentrly we encountered few cases where users wanted to get some properties that are encapsulated inside tracker object. Particularly, users wanted to get
cookieDomain
andpageViewId
to use in app logic. It's possible to getcookieDomain
with lengthy script, but seems not possible at all forpageViewId
.I think we should provide some read-only access to at least these properties (and may be consider another properties) as getter-functions.
The text was updated successfully, but these errors were encountered: