adjust-icon

Set up global callback and partner parameters

The Adjust Android Extension for Adobe Experience SDK enables you to send additional information to Adjust to forward to your callback URL and network partners. Global parameters are string key-value pairs that you can use to communicate more information about a device or user.

Global callback parameters

If you register a callback URL in the Adjust dashboard, Adjust sends a GET request to your callback URL when the SDK sends session data. To append parameters to this callback request, set the global parameters in your code.

Reference

The Adjust class methods manage the global callback parameters. You can add and remove individual parameters, or reset all parameters at once.

Add a global callback parameter

To add a global callback parameter, call the Adjust.addGlobalCallbackParameter method with the following arguments:

key: String

The parameter key.

value: String

The parameter value.

You can add multiple parameters by calling the Adjust.addGlobalCallbackParameter method multiple times.

Adjust.addGlobalCallbackParameter("key", "value");
Adjust.addGlobalCallbackParameter("user_id", "855");

Remove a global callback parameter

To remove a global callback parameter, call the Adjust.removeGlobalCallbackParameter method with the following argument:

key: String

The key of the parameter you want to remove.

Adjust.removeGlobalCallbackParameter("key");

Remove all global callback parameters

To remove all global callback parameters at once, call the Adjust.removeGlobalCallbackParameters method.

This method removes all active global callback parameters, meaning you won't receive any parameters in callbacks from Adjust.

Adjust.removeGlobalCallbackParameters();

Global partner parameters

You can send extra information to your network partners by adding partner parameters. Sharing additional parameters with your external partners enables more granular analysis and facilitates retargeting.

When the Adjust Android Extension for Adobe Experience SDK sends session data, Adjust's servers forward any global partner parameters to any partners you've configured.

Read choose data sharing options to learn how to configure what data you share with external partners.

Reference

The Adjust class methods manage the global partner parameters. You can add and remove individual parameters, or reset all parameters at once.

Add a global partner parameter

To add a global partner parameter, call the Adjust.addGlobalPartnerParameter method with the following arguments:

key: String

The parameter key.

value: String

The parameter value.

You can add multiple parameters by calling the Adjust.addGlobalPartnerParameter method multiple times.

Adjust.addGlobalPartnerParameter("key", "value");
Adjust.addGlobalPartnerParameter("user_id", "855");

Remove a global partner parameter

To remove a global partner parameter, call the Adjust.removeGlobalPartnerParameter method with the following argument:

key: String

The key of the parameter you want to remove.

Adjust.removeGlobalPartnerParameter("key");

Remove all global partner parameters

To remove all global partner parameters at once, call the Adjust.removeGlobalPartnerParameters method.

This method removes all active global partner parameters, meaning no parameters will be sent to network partners.

Adjust.removeGlobalPartnerParameters();

Tutorial: Add and remove global parameters

You can change your global callback and partner parameters at any time by calling the methods described on this page. If you followed the integration guide, your MainActivity.java file should look something like this:

MainActivity.java
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import com.adjust.sdk.Adjust;
import com.adjust.sdk.AdjustDeeplink;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Intent intent = getIntent();
Uri data = intent.getData();
AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data);
Adjust.processDeeplink(adjustDeeplink, getApplicationContext());
}
}

Add new functions to update global parameters:

  • addAdjustGlobalCallback: This function adds a new global callback.
  • removeAdjustGlobalCallback: This function removes a global callback added by addAdjustGlobalCallback.
  • removeAllAdjustGlobalCallbacks: This function removes all global callbacks.
  • addAdjustGlobalPartnerParam: This function adds a new global partner parameter.
  • removeAdjustGlobalPartnerParam: This function removes the global partner parameter added by addAdjustGlobalPartnerParam.
  • removeAllAdjustGlobalPartnerParams: This function removes all global partner parameter.

These functions take a View as an argument and return void. To handle the update, call the relevant Adjust class method within the body of each function.

Here's the updated MainActivity.java file:

MainActivity.java
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Intent intent = getIntent();
Uri data = intent.getData();
AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data);
Adjust.processDeeplink(adjustDeeplink, getApplicationContext());
}
public void addAdjustGlobalCallback(View view) {
Adjust.addGlobalCallbackParameter("user_id", "855");
}
public void removeAdjustGlobalCallback(View view) {
Adjust.removeGlobalCallbackParameter("user_id");
}
public void removeAllAdjustGlobalCallbacks(View view) {
Adjust.removeGlobalPartnerParameters();
}
public void addAdjustGlobalPartnerParam(View view) {
Adjust.addGlobalPartnerParameter("user_id", "855");
}
public void removeAdjustGlobalPartnerParam(View view) {
Adjust.removeGlobalPartnerParameter("user_id");
}
public void removeAllAdjustGlobalPartnerParams(View view) {
Adjust.removeGlobalPartnerParameters();
}
}