GithubHelp home page GithubHelp logo

simpleanalytics / scripts Goto Github PK

View Code? Open in Web Editor NEW
82.0 4.0 13.0 6.11 MB

Open Source Public Scripts for Simple Analytics

Home Page: https://www.simpleanalytics.com

License: MIT License

JavaScript 79.25% Shell 5.88% HTML 14.87%
analytics no-cookies privacy privacy-tools analytics-tracking analyticsjs google-analytics

scripts's Introduction

Simple Analytics logo

Scripts

Simple Analytics is a privacy-first analytics tool with a strong mission: never invade the privacy of your visitors. We just show you the essentials: page views, referrers, top pages, and devices. We don't use cookies. We don't collect any personal data. So no cookie banners or GDPR to worry about. When a service is free you are the product. We won't ever sell your data. As a result, we require a subscription.

Open Source

As our public scripts are very important in our mission to privacy we decided to make the source code available. We use the MIT license which is short and to the point. It lets you do almost anything you want with this project, like making and distributing closed-source versions. See LICENSE for more info.

Contribute

If you want to contribute, you probabaly want to contribute to our /src/default.js or /src/auto-events.js files. These files compile into a few versions of our script by compile.js. They end up on our CDN, custom domains, and the Cloudflare app.

In default.js you see some weird syntax in the comments. For example, /** if ignorepages **/ [some code] /** endif **/. These comments are converted to handlebars like this: {{#if ignorepages }} [some code] {{/if}}. In this case, ignorepages is a variable used in minify.js that takes care of what functionality to show in what script. Our main script is the latest.js script which includes all features. We also have a light.js script that obviously doesn't.

If you contribute, make sure to use npm run build, copy the script to a website, and check if it works correctly.

Run this locally

Just run npm run watch and every file will be validated and compiled on save. We minify our scripts with UglifyJS, a well-known JavaScript minifier.

The most important file of the repository is /src/default.js

Device testing is sponsored by BrowserStack

We run our public script with more than 50 browsers on many different (real) devices. We support Internet Explorer 9 (not sure who is still using that) and up. Including many mobile browsers and less common devices. We get amazing sponsorship from BrowserStack. Thanks, BrowserStack!

BrowserStack Logo

Contact

Feel free to drop any issues you have with our open-source scripts. If you want to contact us you can also use our contact form or email listed here: simpleanalytics.com/contact.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.