snowplow / snowplow/snowplow-javascript-tracker

Pass pre encoded base64 contexts to snowplow javascript api

Open
#733 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

category:browser priority:low type:enhancement
Dominant language
TypeScript
Stars
590
Forks
232
Avg merge
2h 22m
Merged PRs (30d)
3

Description

When doing something like

snowplow('trackPageView', null, [ list,of,contexts_jsons ])

We would like to pass the contexts as a base64 instead of letting snowplow do this. That is pre generate the cx variable parameter.

The reasons are because generating JSON and putting that JSON on the HTML page in a script are fairly tricky due to XSS issues. Also the server is much faster at generating base64 than javascript.

Maybe this is already possible (we are using 2.6.2) in the current version but I could not find it?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin at the trackPageView entry point in the JavaScript/TypeScript API and trace how the supplied contexts become the cx parameter. Check the current handling in version 2.6.2 and define the smallest API-compatible way to accept pre-encoded base64 contexts; done means callers can provide that value without client-side JSON generation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
analytics, api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.