4. Install the Logger

Add the Metalitix Logger to your Decentraland experience

  1. Download and save the metalitix.ts file into the src of your Decentraland project. This script adds a constructor called MetalitixLogger.

  2. Important and instantiate the MetalitixLogger by passing in the apiKey from your project settings found in the Metalitix dashboard. Then, start the logger session by calling startSession() and passing in your Decentraland scene (Entity), which is the main 3D model from your experience or the parent for your scene's models.

    import MetalitixLogger from './MetalitixLogger';
    ...
    const myScene = new Entity()
    mySceneModel.addComponent(new GLTFShape('models/my-scene.glb'))
    engine.addEntity(mySceneModel)
    ...
    const apiKey = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx';
    const logger = new MetalitixLogger(apiKey);
    logger.startSession(mySceneModel);

    Metalitix will record camera movement relative to your scene object's transformations. So, it is not necessary to manually calibrate the scene in the Metalitix dashboard. If you do not pass a scene object, then recorded camera movement will be in world coordinates and manual calibration may be necessary.

  3. Metalitix is now configured to gather analytics on your project! 🎉 To test, engage with your experience to create a session. Then, navigate to the Sessions tab within your project on the Metalitix dashboard. Within a few minutes, you will see your session appear at the top of the table. It will be marked as Active until the session ends. When a session no longer says Active, its data will appear on the Metrics tab. Heatmap data, on the other hand, is calculated in real-time for small projects and every 24 hours for large projects.

Last updated