AdGyde Logo

Integration Process



1. Get the App Key
Sign-in to AdGyde Dashboard, the credentials would have already been provided by AdGyde support team. In case you have not yet received the same, please contact the AdGyde Support Team.

Please follow the given steps :-
Step 1 - Visit the AdGyde Website - https://www.adgyde.com/
Step 2 - Go to Login
Step 3 - Sign-in with the provided credentials
Step 4 - Go to Setup Page
Step 5 - Select Manage Applications from the Application option on Setup Page
Step 6 - Click on "Create an application" option on Top Right corner
Step 7 - Fill in the Application details
Step 8 - Note down the App Key for integration reference

2. Download Android Sample App
Select Download link from the SDK KIT option on Setup Page.
Link will redirect you to AdGyde SDK Page. From here download the Desired Sample Application



Integrate the SDK using the below steps or checking the sample code

3. Integrate SDK into project

3.1 Add library files into the project
  1. Open build.gradle (Project Module) and add below code

    // Top-level build file where you can add configuration options common to all sub-projects/modules.

    buildscript {
    repositories {
    google()
    jcenter()
    }

    dependencies {
    classpath 'com.android.tools.build:gradle:3.5.3'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
    }
    }

    allprojects {
    repositories {
    google()
    jcenter()
    maven {
    // Add this to resolve adgyde aar file
    url "https://dl.bintray.com/adgyde/maven"
    }
    }
    }


  2. Open build.gradle (App Module) and add below code

    apply plugin: 'com.android.application'

    android {
    compileSdkVersion 29
    defaultConfig {
    applicationId "com.adgyde.example"
    minSdkVersion 21
    targetSdkVersion 29
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
    release {
    minifyEnabled false
    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    }
    }

    dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.firebase:firebase-core:17.0.1'
    implementation 'com.google.firebase:firebase-messaging:19.0.1'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    testImplementation 'junit:junit:4.12'
    implementation 'com.android.installreferrer:installreferrer:1.0'

    // For adding AdGyde Sdk with AndroidX support
    implementation 'com.adgyde:adgyde-androidx-sdk:4.1.5'

    // For adding AdGyde Sdk without AndroidX support
    // implementation 'com.adgyde:adgyde-android-sdk:4.1.5'

    }
    apply plugin: 'com.google.gms.google-services'

  3. Click Sync Now option on top, to sync the project and find the library
  4. Build your code to check if everything is working fine

3.3 Initializing AdGyde
Android SDK needs to be initialized in the application. Please check Example project on Android SDK for complete code.

package com.adgyde.example;

import android.app.Application;
import android.util.Log;
import com.adgyde.android.AdGyde;

public class ExampleApplication extends Application implements
Constants {
@Override

public void onCreate() {
super.onCreate();

Log.d(TAG, "ExampleApplication.onCreate()");
// Default channel is Organic
AdGyde.init(this, "Your Appkey", "Organic");

AdGyde.setDebugEnabled(true);
}
}

Please don't initialize the AdGyde SDK on Main Activity, this will result in incorrect session data.

Request you to create a separate application class or use any application class already present in the project. For New application class - create ExampleApplication.java and add the details under application tag in AndroidManifest.xml.

<application android:allowBackup="true" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:supportsRtl="true"
android:theme="@style/AppTheme"
android:name= "com.adgyde.example.ExampleApplication">

<!- application configuration items -->

</application>

Value of android:name parameter should be full name of the newly created application class as shown in the above code snippet

3.4 Pass IMEI to AdGyde
If the application needs to pass the IMEI and record the same along with other user details, then Android SDK needs to be given permission to pick up IMEI explicitly. Even when application has the permission, AdGyde SDK doesn't pick up IMEI without App developer consent which user needs to pass to the SDK using AdGyde.allowPermissionIMEI(context , true) function

Along with above permission make sure application itself has the permission to pick up IMEI. Add Phone state permission in the applications manifest.xml file

<uses-permission android:name="android.permission.READ_PHONE_STATE" />

Below is the sample code to initialize Android SDK with App Developer consent to pass IMEI

package com.adgyde.example;

import android.app.Application;
import android.util.Log;
import com.adgyde.android.AdGyde;

public class ExampleApplication extends Application implements
Constants {
@Override

public void onCreate() {
super.onCreate();

Log.d(TAG, "ExampleApplication.onCreate()");
AdGyde.allowPermissionIMEI(this, true);
AdGyde.init(this, "Your Appkey", "Organic"); // Default channel is Organic

AdGyde.setDebugEnabled(true);
}
}

3.5 Embed Google Play Services into the App
Install the Google Play Services SDK and import it into the project. For download details, Click here.
Add the below code / entry to the AndroidManifest.xml as the last entry in the application tag (Just before </application>)

<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>

NOTE:
AdGyde recommends to always use the latest version of Google play service.

For more details see the link below.
https://developer.android.com/google/play-services/setup.html

Please refer below code

< application
android:name=".ExampleApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">

<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />


<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" \>
</intent-filter>
</activity>

<service android:name="com.adgyde.android.AppJobService"android:exported="true"
android:permission="android.permission.BIND_JOB_SERVICE">
</service>


3.6 Add Install receiver code in the androidmanifest.xml

Note:
Please make sure that following receiver tag is kept inside application tag.

<receiver android:name="com.adgyde.android.InstallReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>

If an application uses multiple INSTALL_REFERRER receivers, you should use com.adgyde.android.MultiInstallReceiver instead of com.adgyde.android.InstallReceiver.
MultiInstallReceiver MUST be the first receiver on Top of all the other INSTALL_REFERRER receivers

<receiver android:name="com.adgyde.android.MultiInstallReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>

If you want to use multiple receivers, then the Manifest.xml file should look like this:

<!--The AdGyde Install Receiver should be placed first and it will broadcast to all receivers placed below it -->
<receiver android:name="com.adgyde.android.MultiInstallReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>

<!--All other receivers should be followed right after -->
<receiver android:name="com.google.android.abc.AbcReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>

<receiver android:name="com.adsmobi.android.xyz.InstallReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>


3.7 Add permissions to project
Add following permissions to AndroidManifest.xml

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE">
</usespermission>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET">
</uses-permission>


3.8 Add dependency to project
Add the following dependency to Android gradle file (Module : android).

dependencies {
// . . .
compile 'com.android.installreferrer:installreferrer:1.0'
// . . .
}


4. Sessions
A session is a conversation between mobile application and user. A session starts with application start and it ends after the user has quit the application.

In AdGyde Android SDK, sessions are linked to the android application Life Cycle and so are calculated automatically without any integration.

5. User Flow
'User Flow' allows the Application Developer to gauge the movement of its users through the activities defined in the application. By analyzing the user flow Sankey diagram, the App developer can predict which activity is most popular among its users and where the drop-off rates are high.

In AdGyde Android SDK, User Flow is linked to the android application Life Cycle and so is calculated automatically without any integration.

6. Uninstall Tracking
AdGyde's Uninstall Tracking functionality allows you to track the number of uninstalls for a specified application. Uninstalls is an important index which helps you to track the quality of users and hence the campaign.

Un-Install detailed integration process

7. Events
AdGyde's Event Tracking allows an application owner to track the events triggered by users. What user is doing in the application are generally tracked using the events like - Registration, Add to Cart, Payment initiated, Payment.
AdGyde supports multiple types of events, please follow the below link to integrate events in the application

Events detailed integration process

8. Deep Linking
Deep linking is the act of launching a mobile app while serving personalized content or sending the users to specific activities within the application.

Deep Linking detailed integration process

9. Demography
AdGyde demography data provides details of Age and Gender wise segregation of User, this can be used by Advertiser to target the new users and run their campaigns effectively.

Demography detailed integration process

10. Pass additional data to SDK
AdGyde allows to pass additional data like Userid, Email and Phone Number to SDK so that same can be correlated to the AdGyde Data and logs.

  • Advertiser's User id
    In case Advertiser needs to relate Applications analytics data with its own User Id then advertiser can pass the same explicitly using AdGyde.setClientUserId("ADG1045984") function. Analytical data then can be shared with the install, events etc. Userid wise also.

  • Email id
    In case Advertiser needs to store and relate Application analytics data with the user's email id then advertiser can pass the same explicitly using AdGyde.setEmail(context, "support@adgyde.com") function. Analytical data then can be shared along with email id

  • Phone Number
    In case Advertiser needs to store and relate Application analytics data with the user's phone number then advertiser can pass the same explicitly using AdGyde.setPhoneno(context, "919876543210") function. Analytical data then can be shared along with phone number

public void onClick(View view)
{
/*
* User Id
* =============
* In case Advertiser needs to store and relate Application analytics data with the Advertisers user id then advertiser
* can pass the same explicitly using AdGyde.setClientUserId("ADG1045984") function.
* Analytical data then can be shared along with User id
*/

AdGyde.setClientUserId("ADG1045984");

/*
* Email Id
* =============
* In case Advertiser needs to store and relate Application analytics data with the users email id then advertiser
* can pass the same explicitly using AdGyde.setEmail(context, "support@adgyde.com") function.
* Analytical data then can be shared along with email id
*/

AdGyde.setEmail(context, "support@adgyde.com");

/*
* Phone Number
* =============
* In case Advertiser needs to store and relate Application analytics data with the users phone number then advertiser
* can pass the same explicitly using AdGyde.setPhoneno(context, "919876543210") function.
* Analytical data then can be shared along with phone number
*/

AdGyde.setPhoneno(context, "919876543210");
}

Menu 1

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Menu 1

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

This website uses cookies in order to improve your experience and our services. By continuing to use our website, agree to the use of such cookies. Click here for Privacy Policy.