1

I have implemented a tracking pixel that is simply an img tag that another party puts on their website. This works by making the src refer to our endpoint with query params set with extra information. The GET hits the server and we collect the QPs. Right now I have just regular key-value query params that refer to user/account info but I need more data (date, time, browser, ip, etc) so I would like to pass something more complicated like a JSON object.

Since this is in the URL, I would have to encode the JSON. I am thinking of just base64 encoding the whole JSON object and setting it as a single query param and decoding it later. Would this be a good thing to do or is there a better way?

4
  • What language is this? There are standard ways of accomplishing this, for example JavaScript: stackoverflow.com/questions/6807180/… Commented Aug 2, 2016 at 14:03
  • I'm using python/flask Commented Aug 2, 2016 at 14:07
  • The date, time, and IP are thing that are easily determined from the request and a system clock. The browser info is generally sent as part of a GET request in the User-Agent header. Why are you trying to encode data that is already being sent in headers or can be easily calculated in the URL? Commented Aug 2, 2016 at 18:17
  • Probably shouldn't have said those, thought they were the most accessible examples of data I might want to track. I'm actually needing to pass discipline specific things like account ids, user ids, segment ids, shopping cart info, activity type (view or click), etc (while still being interested in date, time, IP). Without getting too far in the weeds, the tracking pixel img tag is injected into the page by a JS script which sets the src attribute with info specific to who and what is being tracked. We use browser info, cookies, and some variables in the script to set those query params. Commented Aug 2, 2016 at 19:30

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.