Skip to content
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

Scala Common Enrich: add JavaScript scripting enrichment #378

Closed
alexanderdean opened this issue Oct 15, 2013 · 5 comments
Closed

Scala Common Enrich: add JavaScript scripting enrichment #378

alexanderdean opened this issue Oct 15, 2013 · 5 comments
Assignees

Comments

@alexanderdean
Copy link
Member

Title was: allow support for custom JS logic to write any field based on any other field

This came out of:

The basic idea is: we add a point where JavaScript can be evaluated in our Scalding ETL to update any field in our CanonicalOutput based on the contents of any other field.

This should be the last thing done, when all other values are set.

This would allow some pretty custom stuff to be done without overloading the trackers - e.g. extracting specific values from the referer URI.

For other JS scripting ideas see also:

@jrobgood
Copy link

Another use case for this: we wrote a system tray app a few years back and wanted to log end-user behavior without the app communicating directly to WebTrends (our client's preferred platform.) The desire was to replay the log events from the app's calls to our servers and send the end user IP with the events.

Therefore, relaying/proxying events via the pixel request even down to the UA IP might be a nice piece of functionality to have here.

@alexanderdean
Copy link
Member Author

@jrobgood not sure if I quite follow - but you can pass the end user's IP on the Tracker Protocol with the &ip= parameter. This was added to support proxying.

Actually, we don't have an equivalent for end user's useragent. We should add that - see #381.

@jrobgood
Copy link

Sorry, I did not see that documented in https://github.com/snowplow/snowplow/wiki/snowplow-tracker-protocol so I assumed it was not permitted. So to be clear: I can push the keyword 'ip' into the querystring for the pixel request, and the ETL job will overwrite the reported IP from the GET request in the Cloudfront log with what I pass in?

@alexanderdean
Copy link
Member Author

@jrobgood - correct:

https://github.com/snowplow/snowplow/blob/master/3-enrich/hadoop-etl/src/main/scala/enrichments/EnrichmentManager.scala#L135

I think it's an undocumented feature currently - we'll get it added to the documentation.

@alexanderdean
Copy link
Member Author

Updated design for this: we don't want to mutate the enriched event from JS, but rather to allow the addition of custom contexts generated from JavaScript.

@alexanderdean alexanderdean changed the title Allow support for custom JS logic to write any field based on any other field Scala Common Enrich: add JavaScript scripting enrichment May 31, 2015
oguzhanunlu pushed a commit to snowplow/common-enrich that referenced this issue May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants