News for hackers. Stuff that matters.
Re:The scourge of web analytics by StavrosK on Monday May 29, 2017 @04:35PM (#14441267)
Thank you, but you forgot to include the "windowpop" function :)

I'd love it if I can replace both the Facebook button and GA on my site with something static, thanks.

EDIT: Done, the URL is:

https://www.facebook.com/sharer/sharer.php?u=<url>

Re:The scourge of web analytics by JohnTHaller on Monday May 29, 2017 @04:55PM (#14441379)
Ah, quite right, sorry...

  <script type='text/javascript'>
  function windowpop(url, width, height) {
      var leftPosition, topPosition;
      //Allow for borders.
      leftPosition = (window.screen.width / 2) - ((width / 2) + 10);
      //Allow for title and status bars.
      topPosition = (window.screen.height / 2) - ((height / 2) + 50);
      //Open the window.
      window.open(url+document.URL, "Window2", "status=no,height=" + height + ",width=" + width + ",resizable=yes,left=" + leftPosition + ",top=" + topPosition + ",screenX=" + leftPosition + ",screenY=" + topPosition + ",toolbar=no,menubar=no,scrollbars=no,location=no,directories=no");
  }</script>
Re:The scourge of web analytics by badosu on Monday May 29, 2017 @05:45PM (#14441632)
You can post content in verbatim by indenting it by 2 or more spaces (https://news.ycombinator.com/formatdoc)
Re:The scourge of web analytics by JohnTHaller on Monday May 29, 2017 @06:10PM (#14441761)
Thanks, updated.
Re:The scourge of web analytics by StavrosK on Monday May 29, 2017 @05:11PM (#14441459)
Thank you, unfortunately HN eats that. Here it is, better formatted: https://www.pastery.net/fwytsv/