All Projects → bem-contrib → stat-counters

bem-contrib / stat-counters

Licence: MIT License
The library, which provides statistics counters, e.g. Google analytics, Yandex metrica, etc

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to stat-counters

yii2-stat
Yii2 Multi Web Statistic Module (yametrika, google-analytic, own db-counter)
Stars: ✭ 18 (+12.5%)
Mutual labels:  counter, google-analytics, yandex-metrika
App
Just a little analytics insight for your personal or indie project
Stars: ✭ 40 (+150%)
Mutual labels:  counter, google-analytics
nextjs-google-analytics
Google Analytics for Next.js
Stars: ✭ 242 (+1412.5%)
Mutual labels:  google-analytics, google-tag-manager
Social-Media-Monitor
Automatically monitor and log fan counters from social media(Facebook Pages, Twitter, Instagram, YouTube, Google+, OneSignal, Alexa) using APIs to Google Spreadsheet. Very useful for website admins and social media managers.
Stars: ✭ 36 (+125%)
Mutual labels:  counter, google-analytics
django-sitemetrics
Reusable application for Django that offers easy integration with different site metrics service providers.
Stars: ✭ 41 (+156.25%)
Mutual labels:  google-analytics, yandex-metrika
shopify-gtm-ga
Enhances Google Analytics and integrates Google Tag Manager for Shopify.
Stars: ✭ 44 (+175%)
Mutual labels:  google-analytics, google-tag-manager
tag-manager
Website analytics, JavaScript error tracking + analytics, tag manager, data ingest endpoint creation (tracking pixels). GDPR + CCPA compliant.
Stars: ✭ 279 (+1643.75%)
Mutual labels:  google-analytics, google-tag-manager
unified-analytics
ready-to-deploy custom web analytics collection & reporting for government
Stars: ✭ 20 (+25%)
Mutual labels:  google-analytics, google-tag-manager
bemer
Template engine. BEMJSON to HTML processor.
Stars: ✭ 33 (+106.25%)
Mutual labels:  bem
Stop.Google.Analytics.Ghost.Spam.HOWTO
How to stop Google Analytics "Ghost" Spam using a well curated list of spam referrer domains and web sites. Simple and easy to use with instructions for creating Segments in Google Analytics using our google-exclude files.
Stars: ✭ 21 (+31.25%)
Mutual labels:  google-analytics
counters
A GoLang implementation of counters.
Stars: ✭ 15 (-6.25%)
Mutual labels:  counter
benjamincarlson.io
My personal website built with Next.js, Chakra UI, Firebase, and next-mdx-remeote.
Stars: ✭ 102 (+537.5%)
Mutual labels:  google-analytics
csgo richpresence
Discord Rich Presence support for Counter-Strike: Global Offensive!
Stars: ✭ 16 (+0%)
Mutual labels:  counter
vue-yandex-metrika
Vue plugin for Yandex Metrika
Stars: ✭ 64 (+300%)
Mutual labels:  yandex-metrika
aws-web-analytics
Privacy-focused alternative to Google Analytics on AWS Pinpoint
Stars: ✭ 45 (+181.25%)
Mutual labels:  google-analytics
all-digital
Comcast All Digital CSS
Stars: ✭ 14 (-12.5%)
Mutual labels:  bem
svelte-google-analytics
Google Analytics component for Svelte
Stars: ✭ 41 (+156.25%)
Mutual labels:  google-analytics
kirby-ga
Kirby GA - Google Analytics
Stars: ✭ 16 (+0%)
Mutual labels:  google-analytics
bem-express
BEM project-stub with BEMTREE and express
Stars: ✭ 45 (+181.25%)
Mutual labels:  bem
web-analytics-handbook
Handbook - Rendezvous between developers and web data
Stars: ✭ 23 (+43.75%)
Mutual labels:  google-analytics

Statistics counters BEM library

Build Status Coverage Status

A library for web analytics that provides site statistics counters to any BEM-based project.

Blocks inside

Get the library:

via bower:

$ bower install bem-stat-counters --save

via npm:

$ npm install https://github.com/bem-contrib/stat-counters.git --save

How to use

Include the library to the levels declaration in your compiler tool configuration (e.g. ENB or bem-tools):

ENB example

function getLevels(config) {
    return [
        // vendors levels
        {
            path: 'vendors/bem-stat-counters/common.blocks',
            check: false
        },
        // your own levels
    ].map(function(levelPath) { return config.resolvePath(levelPath); });
}

bem-tools example

exports.getConfig = function() {

    return extend({}, this.__base() || {}, {

        bundleBuildLevels: this.resolvePaths([
            // vendors levels
            'vendors/stat-counters/common.blocks'
            // your own levels
        ])

    });

};

bem-tools example if you use bem-project-stub

getLevelsMap: function() {
   return {
       desktop: [
            // vendors levels
            'vendors/stat-counters/common.blocks'
            // your own levels
       ]
   };
}

Declare a counter in your project BEMJSON:

{
    block: 'footer',
    content: [
        // smth content,
        {
            block: 'yandex-metrica',
            params: {
                id: '0000000',
                webvisor: true,
                clickmap: true,
                trackLinks: true,
                accurateTrackBounce: true,
                v2: true
            }
        }
    ]
}

How to declare blocks

yandex-metrica

Set the following parameters of the block:

  • id — required
  • webvisor — optional
  • clickmap — optional
  • trackLinks — optional
  • accurateTrackBounce — optional
  • v2 — optional

Example

{
    block: 'yandex-metrica',
    params: {
        id: '0000000', // required param
        webvisor: true,
        clickmap: true,
        trackLinks: true,
        accurateTrackBounce: true,
        v2: true
    }
}

google-tag-manager

Set the following parameters of the block:

  • id — required

Example

{
    block: 'google-tag-manager',
    params: {
        id: 'GTM-XXXX'
    }
}

google-analytics

Set the following parameters of the block:

  • id — required

Example

{
    block: 'google-analytics',
    params: {
        id: 'UA-XXXXXXXX-X'
    }
}

Also the block has a simple API to track custom user events on page. Click here to learn more.

statcounter

Set the following parameters of the block:

  • id — required
  • security — required

Support only invisible mode.

Example

{
    block: 'statcounter',
    params: {
        project: XXXXXXXX,
        security: 'YYYYYYYY'
    }
}

Content Security Policy (CSP) support

You can use counters even if your web server has CSP settings which forbid inline scripts using. In this case you should provide the same value of the nonce-parameter in the CSP http header and the html attribute for inline script.

Example

  1. CSP header
Content-Security-Policy:
 ...
 script-src 'nonce-FOO'
 ...
  1. counter block declaration
{
    block: 'google-analytics', // or any another block of the library
    params: {
        id: 'UA-XXXXXXXX-X'
    },
    nonce: 'FOO'
}

License

MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].