Skip to main content

Key counter

This plugin counts key strings. Key string provided in configuration will be treated as an information to increase the value of a key in profile. This plugin can be used for simple statistics e.g. count how many user visited us on mobile device vs other devices like desktop or tablet.

Examples

For example if the key is a simple value and equals to:

[
  "a",
  "b",
  "a"
]

then the key count equals to

{
  "a": 2,
  "b": 1
}

If the key values are:

[
  {"key1": 1},
  {"key2": 2},
  {"key1": 2}
]

then the key will be increased by the provided value. Then key1 + 1, key2 + 2, and key1 + 2. And the result will be:

{
  "key1": 3,
  "key2": 2
}

You may also want to pass data the following way:

  {
    "key1": 1,
    "key2": 2
  }

This will also work and the result will be:

  {
    "key1": 1,
    "key2": 2
  }

Configuration

{
  "key": "desktop",
  "save_in": "profile@stats.counters.MobileVisits"
}

Example of configuration with dot notation in key and save_in

{
  "key": "event@session.context.browser.agent",
  "save_in": "profile@stats.counters.visits_origins"
}

Or with multiple key fields.

{
  "key": [
    "event@session.context.browser.agent",
    "event@session.context.browser.agent.string"
  ],
  "save_in": "profile@stats.counters.visits_origins"
}
  • key may be a string or a list of strings. Also, a dot notation can be used to access data.
  • save_in point to data in profile that will hold the information on key counts. It should be empty object {} or a key-value object. save_in holds the original data that will be incremented.

Metadata

Release files for tracardi-key-counter 0.6.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tracardi-key-counter 0.6.0.1
File Size Uploaded
tracardi-key-counter-0.6.0.1.tar.gz 8.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tracardi-key-counter 0.6.0.1
File Interpreter ABI Platform
tracardi_key_counter-0.6.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 16.7 kB

Release files / tracardi-key-counter-0.6.0.1.tar.gz

Download URL tracardi-key-counter-0.6.0.1.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5ddcc58fd840cd48eb13dec51c5fd15c35b932fdb1e26fcf49785337aa2a70a9
BLAKE2b-256 checksum
How to use checksums
62a08e7c01b5b94ad0ad674a6ecdc7b7cd8dd46dafe8f323b65a3e19657d2d40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.10

Release files / tracardi_key_counter-0.6.0.1-py3-none-any.whl

Download URL tracardi_key_counter-0.6.0.1-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
05c3fcc6375f711d65a5c32e74870909bd69294d300733b99cf2acb9b38be29b
BLAKE2b-256 checksum
How to use checksums
d4d65689adf7d68adedcc6ba1f2a6a95c429e8fd977684dea581ae6f5c3eaf39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.6.0.1 This release

2 release files

0.6.0

2 release files

0.1.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page