PRX / pixel.prx.org

API Gateway pixel tracker
GNU Affero General Public License v3.0
0 stars 0 forks source link

Setup API Gateway repo #1

Closed cavis closed 5 years ago

cavis commented 5 years ago

Start out with something similar to proxy.prx.org.

brandonhundt commented 5 years ago

?url=<any-string>

example together with the key: /i.gif?key=msn&url=https://www.pri.org/stories/2019-04-08/elections-loom-indias-modi-vows-end-terrorism-kashmir-more-military-force

brandonhundt commented 5 years ago

And if the URL needs to be encoded, and/or relative. That works for me.

cavis commented 5 years ago

So the ?url is the canonical url then (not the url it was accessed under, which is the "referer" header).

What is key=msn representing in your example? Since I'm already confused, that probably indicates we need some better query-param / bigquery-field names here.

brandonhundt commented 5 years ago

Yes, url is the canonical url.

For the key, I was just thinking that it would simply identify the source feed, because the canonical url could appear in multiple feeds.

cavis commented 5 years ago

Okay, plan is that this will track 6 things to bigquery:

  1. The ?k= key query param (any string)
  2. The ?c= canonical-url query param (any string)
  3. The user-agent header
  4. The x-forwarded-for header (or fall back to the source-ip of the request)
  5. The referer header
  6. The milliseconds epoch of the request