Installing Atlas Analytics

Option #1 - Manual Install

Step 1 - Create an atlas-analytics.ts file

Here is the gitlab for atlas-analytics: https://gitlab.com/atlas-corporation/atlas-analytics

You will need to save the file atlas-analytics-service.ts file to your scene's /src/ directory. This will sit next to a file likely namedgame.ts.

Atlas Analytics requires the native ecs-scene-utils library to work properly. In your package.json file, make sure you have "@dcl/ecs-scene-utils": "latest"listed in both your bundleDependencies and devDependencies.

"devDependencies": { 
    "@dcl/ecs-scene-utils": "latest", 
    "decentraland-ecs": "latest" 
}, 
"bundleDependencies": [ 
    "@dcl/ecs-scene-utils" 
]

Note: Remove any references to "bundledDependencies" as this is a known bug.

If you were looking to quickstart, you can stop here. Once your scene is deployed you will have access to a dashboard populated with your scene's data

[Optional] Step 2 - Initialize Atlas Analytics

You can open the atlas-analytics.ts file and configure the default settings using the constant parameters set near the top:

const branchName: string = "My Scene Branch";
const pollingInterval: number = 5000;
const debug: boolean = false;
  • The first parameter will be the build name of your scene so you can distinguish from previous builds deployed to the same scene name.

  • The second parameter is the ping frequency in milliseconds (default is 5 seconds); you may increase the time if you'd like but we wouldn't recommend decreasing it as it may affect scene performance.

  • The third parameter is debug output. If set to true, you will see additional information in the browser console when you run the scene but so will your users.

[optional] Step 3 -Update your scene.json

You can use your scene.json file to govern access to your scene's analytics dashboards. By default, the owner of the land will have access. To grant access to another user, assign their wallet in the tags field of your scene.json file with an "atlas" tag as follows:

"tags": [
    "atlas:0xE400A85a6169bd8BE439bB0DC9eac81f19f26843",
    "atlas:0x3fB38CEe8d0BA7Dcf59403a8C397626dC9c7A13B"
    ],

Alternatively, you may opt to grant public access to your scenes using the following in your tags field:

tags = ["atlas:*"],

[optional] Step 4 -Add scene event tracking

You may have specific events that you wish to track. To do so, in a code block for the event trigger, place the following code:

First, import atlas-analytics into your code file, and then use the following code to define an event name to reference later:

import { atlasAnalytics } from "./atlas-analytics-service";
box.addComponent(new OnPointerDown((e) => {
   atlasAnalytics.submitButtonEvent("<my event name>", box);
 }));

In the above example, every time a user clicks the "box" object an event will be created using your event name. You can name your event something identifiable that will be able to be viewable in your dashboards. (Note: please do not use event names like load-timer or ping as it will cause conflicts in your dashboards.

Option #2 - Install NPM Packages

Coming soon...

Last updated