Git Product home page Git Product logo

adjustwrapperandroid's Introduction

Google Analytics for Firebase Wrapper for Adjust

Copyright (c) 2019 Google Inc. All rights reserved.

The Google Analytics for Firebase wrapper for Adjust allows developers to easily send information to both the Adjust and Google Analytics for Firebase backends.

Using the Wrapper

In order to use the Adjust wrapper:

  1. Follow the steps here to set up the Google Analytics for Firebase SDK in your app.
  2. Copy the source files inside the AdjustWrapper directory into your project.
  3. Register your Adjust token to event mapping and application Context using AdjustWrapper.initialize() after Firebase initialization. This mapping allows the wrapper to log events to the Google Analytics SDK with the real name (not just the token).
  4. Replace supported references to Adjust API with AdjustWrapper and AdjustInstance with AdjustInstanceWrapper
  5. Replace references to AdjustEvent with WrappedAdjustEvent.

Some methods are not supported by the wrapper. For these methods, directly call the base implementation on the Adjust object or your AdjustInstance reference.

Registering the Event Mapping and Application Context

Instead of using event names within the SDK, Adjust uses tokens that map to event names on the backend. Since the Google Analytics for Firebase SDK is unaware of this mapping, it should be provided to the wrapper to ensure that the event names show up properly in the Firebase console. Register it by passing a map into the AdjustWrapper.initialize() API. The map should reflect the token to event name mapping provided by Adjust. Make sure that this mapping is established before the first Adjust event is logged, or event name shown in the Firebase console will be incorrect.

In addition, a Context is required before the wrapper can log custom events through Google Analytics for Firebase. Events logged before a Context is provided will be queued on the device until provided using the AdjustWrapper.initialize() API.

Example:

Map<String, String> tokenMap = new HashMap<>();
tokenMap.put("abcde1", FirebaseAnalytics.Event.SIGN_UP);
tokenMap.put("abcde2", FirebaseAnalytics.Event.TUTORIAL_BEGIN);
tokenMap.put("fghijk", "your_custom_event");

AdjustWrapper.initialize(context, tokenMap);

Supported Methods

The following API methods and properties are supported in the AppsFlyer wrapper. Use the wrapper by replacing Adjust in these instances with AdjustWrapper:

  • Adjust.trackEvent(AdjustEvent) -> AdjustWrapper.trackEvent(WrappedAdjustEvent)

Replace AdjustEvent with WrappedAdjustEvent in these instances:

  • new AdjustEvent(token) -> new WrappedAdjustEvent(token)

adjustwrapperandroid's People

Contributors

dgvawter avatar diminishedprime avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.