Integration steps
  1. Download our plugin for Ionic Framework
  2. Create your ionic project
    ionic start cordovaPluginApp tabs
    cd cordovaPluginApp
  3. Extract plugin into your application folder:
  4. Install plugin into your project:
    ionic cordova plugin add cordova-plugin-attributo
  5. Inicialize the plugin in the onDeviceReady event. For ionic it looks like this:
    import { Component } from "@angular/core";
    import { Platform } from "@ionic/angular";
    import { SplashScreen } from "@ionic-native/splash-screen/ngx";
    import { StatusBar } from "@ionic-native/status-bar/ngx";
    
    declare var attributoPlugin: any;
    
    @Component({
      selector: "app-root",
      templateUrl: "app.component.html",
      styleUrls: ["app.component.scss"]
    })
    export class AppComponent {
      constructor(
        private platform: Platform,
        private splashScreen: SplashScreen,
        private statusBar: StatusBar
      ) {
        this.initializeApp();
      }
    
      initializeApp() {
        this.platform.ready().then(() => {
          this.statusBar.styleDefault();
          this.splashScreen.hide();
    
          if (this.platform.is("android") || this.platform.is("ios")) {
            const attributoDebug = false;
            if (this.platform.is("android")) {
              attributoPlugin.initAttributo(
                "YOUR_ANDROID_APPID",
                "YOUR_ANDROID_SECRETKEY"
              );
              attributoPlugin.setDebugMode(attributoDebug);
              attributoPlugin.measureSession();
            }
    
            if (this.platform.is("ios")) {
              attributoPlugin.initAttributo(
                "YOUR_IOS_APPID",
                "YOUR_IOS_SECRETKEY"
              );
              attributoPlugin.setDebugMode(attributoDebug);
              attributoPlugin.measureSession();
            }
    
            this.platform.resume.subscribe(async () => {
              attributoPlugin.measureSession();
            });
          }
        });
      }
    }
Advertising Identifiers

To make attribution more accurate please add libraries for collectiong device identifiers:

iOS

The Apple Advertising ID is automatically collected by the plugin. It requires to include

AdSupport.framework

library in your iOS project but this library is automatically added when you install the plugin

Android

The Google Advertising ID is automatically collected by the plugin and it requires dependency

com.google.android.gms:play-services-ads

fromGoogle Play Services SDK. This library will make attribution more easy to do.

Measuring Events

Call

attributoPlugin.measureEvent()

for events you want to track and attribute