
Show HN: Mirrorshades – Simple web analytics - aparks517
http://getmirrorshades.com/
======
ttd
For such simple metrics (visitor count and referral), wouldn't it be possible
to use server-side tracking, e.g. by parsing an Apache access log? Are there
any packages out there to do simple analytics without requiring client-side
tracking?

~~~
tyingq
Webalizer, awstats, goaccess.

Goaccess is interesting in that it has both a live, terminal, curses interface
as well as HTML output. [https://goaccess.io](https://goaccess.io)

~~~
StavrosK
I've actually writing a post these days about this exact thing: Analytics
alternatives to Google Analytics that are more private, more accurate and
faster. It's a very interesting topic, GoAccess is my software of choice but
it has some odd UX that is currently being worked on by the maintainer.

------
lettersdigits
>
> [http://getmirrorshades.com/view.html?siteKey=[SECRET_SITE_KE...](http://getmirrorshades.com/view.html?siteKey=\[SECRET_SITE_KEY\])

someone sniffing the network traffic can see the SECRET_SITE_KEY .. isn't it a
security concern? or am i missing anything?

~~~
aparks517
Thanks. HTTPS is now live. :)

~~~
bencollier49
But you've got the secret site key in your server logs as it's in all the GET
statements. Don't use third-party log analysis would be the suggestion I
suppose.

~~~
lettersdigits
i didn't even think about that angle (being careful from third party logs for
http GETs with sensitive info in the url). thanks

------
iDemonix
Out of interest is this just a permanent side project that's almost completed,
or something you're hoping to grow and monetise?

Also, what stack are you using? I'm interested as I've been slowly designing
my own mini project (with SaaS aspirations, SaaSpirations?) that does very
similar metrics.

------
kapuru
I think I'm in love.

I just recently switch from GA to Gauges, because the referral spam and bloat
was annoying me.

I'm definitely going to use this on my next project. Simple and beautiful.

Thanks for sharing!

~~~
fiatjaf
I'm developing a simple web analytics also (it's strange to see Mirrorshades
here since I started developing something like it some weeks ago) and I want
to know about referral spam: Mirrorshades per se doesn't have any better spam
filtering than Google Analytics, right? The gain from switching to it is just
because spammers still don't know how to spam Mirrorshades, or am I wrong?

~~~
aparks517
Spammers are already doing what they do. I have rudimentary measures in place,
but additional data will enable a more sophisticated response. I use the
service myself and find spam to be crazy-making. So... ;)

~~~
fiatjaf
How are they doing what they do? How could a spammer get to know Mirrorshades
protocol to send a false referrer report (which is not the Referer header) in
an AJAX request?

~~~
aparks517
At least some of them appear to use a more general-purpose method than that.
They actually load pages and execute scripts with document.referrer and the
Referrer header faked-up. Though it's presumably more resource-intensive, it
has the benefit of working for a wide variety of analytics setups, both hosted
and server-side.

~~~
fiatjaf
Oh, right, they just got document.referrer, I had forgotten about that.

What if the analytics server actually parsed the referring page to see if
there's a real link there and only confirm the referrer after that? Isn't
there a third party service that checks these things?

------
iDemonix
If I send a manual PATCH of {"source":"referral-spam-here.com"}, obviously it
makes it in to my metrics.

It seems like someone could just scan for sites with a site ID matching your
format, then a quick burst of 100 PATCH requests and you're now experiencing
the same stuff that makes Google Analytics so painful to use.

Do you have any plans to combat stuff like this? This is typically my biggest
gripe with analytics platforms, the spam can make them unusable and is hard to
protect against.

~~~
aparks517
Yes. I have basic measures already in place and a good idea of additional
steps I would like to take.

------
fiatjaf
I can't get
[https://getmirrorshades.com/agent.js](https://getmirrorshades.com/agent.js)!

~~~
aparks517
Oh! Sorry about that. Should be fixed shortly.

~~~
e12e
[http://getmirrorshades.com/agent.js](http://getmirrorshades.com/agent.js)

Does look nice and clean - but I would love to see a license, not just a
copyright notice. I am unsure if such a short snippet really is copyrightable?
It is tempting to just change the post url and whip up something simple for
self-hosting... but tricky to do and redistribute as long as there is no
license on the file. For such short snippets I would recommend cc0 - or
perhaps bsd.

------
TheFullStack
The simplicity of this is pretty compelling. I use GA a lot and it can
definitely be a time-sink. Mirror Shades may be a good alternative for
beginners who are overwhelmed by GA or for simple landing sites that don't
need the full GA suite right away. For my next landing page test, I'll try
Mirror Shades out.

------
idoco
I really love the simplicity, I think I will use it for one of my side
projects! (also here at Show HN)

Quick question, why did you choose to use a PATCH request and get involved
with CORS issues, instead of injecting an image element with a tracking pixel
(web beacon)?

------
thangngoc89
Ask HN: Is there any services that take my Google Analytics report and produce
a simple report like this one? I may not need the full-blown report of GA
right now but I guess I'll need it as some point in the future.

~~~
tyingq
You can reproduce it within GA using a custom report, something like this:
[http://imgur.com/a/DDzdc](http://imgur.com/a/DDzdc)

------
chrisma0
Neat! agent.js initially failed on my site, as it wasn't the last script on
the page and _siteId_ was set to _null_ (line 14):

    
    
      var siteId = scriptElements[scriptElements.length - 1].getAttribute('data-siteId');
    

Maybe that could be better documented?

Alternatively a change in the way that the script element (and the siteId) is
detected could be helpful (instead of lines 13, 14):

    
    
      var siteId = document.querySelector('script[data-siteId]').getAttribute('data-siteId');

~~~
aparks517
Thank you! This was very helpful feedback. I added the async attribute to the
script tag late in the game and didn't think about how it would interact with
this. I've updated the agent script with a more robust method of finding the
site ID and am deploying it now.

------
assafmo
Awesome! I was just having problems opening a GA account and then I fount this
Show HN. This is exactly what I was looking for - fast and easy setup, updates
instantly, simple and exactly the two metrics I am interested in.

I've already started using it and I'll send feedbacks along the way.

Good luck!

------
thenomad
Minimal and cool. Nice.

Some kind of top pages or top bounce rate stats would also be good. Usually
I'm using analytics to figure out either a) what's working or b) what's
broken.

~~~
aparks517
I'm eager to keep that stats page small, but at the same time I'd like it to
have what people need to see. So this feedback is particularly valuable to me
and I've made a note of it. Thanks!

------
mahesh_rm
Neat. How can I send custom data from here: `// Data to send var payload =
JSON.stringify({ source: source, ip: 'trying_ip' }); `?

------
feistypharit
Looks interesting, awesome to see more Michiganders too!

------
kyriakos
Benefits over ga? Honest curiosity

~~~
robinhood
Seems obvious: simplicity, no setup required apart from pasting one line of
code.

~~~
softawre
Isn't GA just one line of code too?

The only benefit I see is that Google doesn't have the data.

~~~
overcast
Well, it's multiple lines of data, but yes, it's just a simple copy/paste.

------
orhanbayram
What are the benefits over Google Analytics or Piwik or Countly?

~~~
fiatjaf
It's explained at the link, if only you could read.

