1.0.1 • Published 2 years ago

@t-ski/rapidjs--nocookie-ga v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

No-Cookie Google Analytics

Cookie-less Google Analytics integration with automatic tag injection.

npm install @t-ski/rapidjs--nocookie-ga

Concept

The Plug-in implements an automatic integration of Google Analytics (via tag) given an indivudal Tracking-ID and custom events. Client identification is provided with a validity interval hashed along the related IP (md5).

Integration

Google Analytics is automatically integrated into the Plug-in effective web pages (any by default).

Tracking ID

In order to associate the Analytics with an individual account, the respective Tracking-ID must be provided to the Plug-in config trackingId property:

"@t-ski/rapidjs--nocookie-ga"."trackingId": <tracking-id>

Custom events

Usually the Analytics interface can be used from the manually assigned method ga(). Using the Plug-in the interface is moved to its scope.

Scripted

To emit a custom event from a script, simply use the Plug-in scope default method mediating the normal call:

Syntax

rapidJS["@t-ski/rapidjs--nocookie-ga"](event, key, value = null)

Parameter

NameTypeDescription
eventStringEvent
keyStringKey
value optionalAnyValue

Configured/Serialized

Static, generelly effective events can also be configured in the Plug-in configuration file giving an event call objects array:

"@t-ski/rapidjs--nocookie-ga"."serializedEvents": [
    {
        event: "<event>",
        key: "<key>",
        value?: "<value>"
    }
]

Identification validity

By default a client is – provided their respective IP does not change for any reason – identified for seven days before their ID changes. The validity interval can be altered in days from the respective configuration:

"@t-ski/rapidjs--nocookie-ga"."validity": <duration-in-days>