title: Google Analytics proxy
body: <p>I have a special situation where the sites visitors can access the page from a certain domain but no others. So HTML and assets are no problem as long as they are stored on the server. Google Analytics on the other hand requires a download of analytics.js from Googles servers, which is impossible.</p>
  
  <p>So I'm looking for a way to proxy this. The webserver itself has internet access and could relay the trafic. To report to Google about my page view, a single pixel GIF is downloaded from Google, described here: <a href="https://developers.google.com/analytics/resources/concepts/gaConceptsTrackingOverview" rel="noreferrer">https://developers.google.com/analytics/resources/concepts/gaConceptsTrackingOverview</a></p>
  
  <p>I think it would be kind of easy to get all the parameters in the GIF and use the measurement protocol to report to Google from the server - but the hard bit is to get all this info to the server. To download analytics.js and modify it to go to my own server seems to me as a hack that ain't future proof at all. To just get the current page from the user to the server is not a big deal, but we would like to get the user id, browser version and everything you get with Analytics.</p>
  
  <p>How would you do it? Do you find a solution for this?</p>