npm.io
1.3.1 • Published 2 years ago

appscoper

Licence
ISC
Version
1.3.1
Deps
2
Size
14 kB
Vulns
0
Weekly
0

Introduction

appscoper is a plugin designed to work with AppScoper a platform that enables easy event tracking and analysis for your application. This plugin simplifies the process of AppScoper's main functionality by providing a sendEvent function that triggers your desired events.

Installation

To install appscoper, run the following command in your terminal:

npm install appscoper

Usage

Step 1: Create account creating account at AppScoper

Step 2: get the DEV_KEY

Before your developer can install and integrate the SDK, you must retrieve the DEV_KEY AppScoper uses the DEV_KEY key to uniquely identify your account. The DEV_KEY is mandatory because it allows the SDK to securely send and retrieve data that belongs to your account. In AppScoper go to app settings and copy your DEV_KEY

Step 3: Import setAppKey, sendEvent function

import { sendEvent, setAppKey } from "./node_modules/appscoper/src/index.js";

Step 4: Initialize SDK

-Call setAppKey with the DEV_KEY you copied at step2 as a parameter

setAppKey("<YOUR_DEV_KEY>");

Step 5: Send event to AppsScopper for processing

sendEvent(
  "<YOUR_APP_NAME>",
  "<USER_IDENTIFIER>",
  "<APP_SCREEN>",
  "<EVENT_NAME>",
  "<AMOUNT>",
  "<CURRENCY>",
  "<PRODUCT_SLUG>",
  "<PRODUCT_COUNT>",
  "<ARRAY_OF_ORDER_IDS>"
);

In the example above, the sendEvent function is used to send an event to AppScoper. You need to provide the following parameters:

  • <YOUR_APP_NAME>: (string) The name or identifier of your application.

  • <USER_IDENTIFIER>: (string) A unique identifier for the user triggering the event.

  • <APP_SCREEN>: (string) The name or identifier of the screen or page where the event occurred.

  • <EVENT_NAME>: (string) The name of the event being tracked (e.g., "PURCHASE" or "SEARCH").Predefined Events - Click here to check all the predefined events.

  • <AMOUNT>: (number) The amount associated with the event (e.g., purchase amount).

  • <CURRENCY>:(string) The currency in which the amount is expressed (e.g., "USD" or "EUR").

  • <PRODUCT_SLUG>: (string) The unique identifier or name of the product associated with the event.

  • <PRODUCT_COUNT>: (number) The quantity or count of products involved in the event (e.g., items in a cart).

  • <ARRAY_OF_ORDER_IDS>:(array of strings) An array of order IDs related to the event (e.g., for purchases). Make sure to replace the example values with your actual data.

Predefined Events

The sendEvent function in the appscoper plugin allows you to track various events in your application. Here are the allowed event names that you can use:

Event Name Description
UNKNOWN_EVENT
PURCHASE This event signifies that a user has made a purchase within your application. You can use it to track transactions and measure the revenue generated from purchases.
APP_INSTALL The APP_INSTALL event is triggered when a user installs your application. It helps you monitor user acquisition and can be valuable for marketing analysis.
SAVE SAVE events should be recorded when a user saves content or data within your application. This can help you understand user engagement and content management patterns.
START_CHECKOUT This event indicates the beginning of a checkout process. You can use it to monitor the user journey towards making a purchase or taking a desired action.
ADD_CART ADD_CART events are logged when a user adds items to their shopping cart or basket. This allows you to track products of interest and potential purchases.
VIEW_CONTENT Use VIEW_CONTENT events to record when a user views specific content, such as articles, images, or videos, within your application.
ADD_BILLING ADD_BILLING events can be used to track the addition of billing information, which is crucial for transactions and subscription-based services.
SIGN_UP This event is triggered when a user signs up or creates an account in your application. It helps monitor user registrations and conversions.
SEARCH SEARCH events are logged when a user performs a search operation within your application. These events help track user information retrieval and content discovery.
LEVEL_COMPLETE LEVEL_COMPLETE events can be used in gaming applications to indicate when a user successfully completes a level or stage.
APP_OPEN This event is triggered each time a user opens your application. It provides insights into user engagement and how often the app is used.
PAGE_VIEW PAGE_VIEW events are recorded when a user navigates to and views a specific page or screen within your application.
SUBSCRIBE Use SUBSCRIBE events to monitor when users subscribe to a service, newsletter, or other recurring content.
AD_CLICK This event is triggered when a user clicks on an advertisement within your application. It helps evaluate the effectiveness of ad campaigns.
AD_VIEW AD_VIEW events are recorded when a user views an advertisement, even if they don't click on it. This data can be used for ad performance analysis.
COMPLETE_TUTORIAL In gaming or tutorial-based applications, this event is logged when a user successfully completes a tutorial or onboarding process.
INVITE INVITE events can be used to track when users send invitations or referrals to others, promoting your application through social connections.
LOGIN This event is triggered when a user logs into their account. It helps monitor user engagement and login patterns.
SHARE SHARE events are recorded when a user shares content from your application on social media or other platforms.
RESERVE RESERVE events can be used in reservation or booking applications to track when a user reserves a spot or service.
ACHIEVEMENT_UNLOCKED In gaming applications, this event is logged when a user unlocks an achievement or earns a badge, enhancing the gaming experience.
ADD_TO_WISHLIST This event is triggered when a user adds an item or content to their wishlist or favorites list, indicating user interests.
SPENT_CREDITS SPENT_CREDITS events are recorded when users spend in-app credits or currency. Useful for tracking virtual economy interactions.
RATE Use RATE events to track when users provide ratings or reviews for your application. Valuable for feedback collection and user sentiment analysis.
START_TRIAL The START_TRIAL event is logged when a user begins a trial or free trial period for a paid service. Useful for monitoring trial conversions.
LIST_VIEW LIST_VIEW events can be used to track when users view lists or catalog pages in your application.
VISITATION VISITATION events are logged when a user visits a particular location or venue within your application, such as a physical store in a retail app.
CUSTOM_EVENT_1 These custom events are placeholders for user-defined events with associated codes. You can define their meanings according to your application's specific actions and objectives.
CUSTOM_EVENT_2
CUSTOM_EVENT_3
CUSTOM_EVENT_4
CUSTOM_EVENT_5

When using the sendEvent function, make sure to provide the correct event name according to your tracking requirements.