We have a few servers running that serve up a tiny transparent GIF in response to a GET request. A painful setup that only exists due to the limited client-side abilities of the Mxit client.

Our pageview tracking setup (primarily for Google Analytics):

  • Prep required data to place into the IMG tag’s src attribute
  • Include cache busting nonce
  • Client calls special server for the image
  • Special server calls the analytics API and returns the GIF

This is a round-about way of capturing a pageview event. Fortunately, Google made the Measurement Protocol and deprecated the old Mobile Websites API. Bottom line is that the Measurement Protocol API allows you to register a pageview event via a GET call.

Meaning we can use the following setup instead:

  • Prep Measurement Protocol required data to use in the IMG tag’s src attribute
  • Include cache busting nonce
  • Client calls Google’s Analytics API directly and returns the GIF

We would be able to turn off all our proxy analytics servers if we weren’t using them for other tracking services. But, we will be able to reduce the number of active instances dramatically and possibly even combine the remaining functionality into other servers.