Skip to content

Instrumenting Your App with Paco Triggers

Bob Evans edited this page Oct 8, 2013 · 9 revisions

You can trigger a user to respond to an experiment by sending Paco a Broadcast Intent on Android.

This allows inter-app communication for two main uses:

  • Conducting User Experience Research by instrumenting the Android app to be studied
  • Building additional functionality as separate apps that can trigger Paco experiments

How it Works

  1. When the user of your app causes an action which you instrumented to execute, the broadcast call to Paco will execute.
  2. Paco is listening for these Paco Trigger Broadcast events.
  3. If there is an running experiment that is listening for the Source Identifier, Paco will create a Notification for that experiment informing the user to respond.

Steps to Trigger Paco from Your App

  1. Add the following helper function to your system.

    // @param String sourceIdentifier This uniquely identifies your action and is
    //   specified in your Paco Experiment as the source action.
    private void notifyPaco(String sourceIdentifier) {
        Intent i = new Intent("com.pacoapp.paco.action.PACO_TRIGGER");
        i.putExtra("sourceIdentifier", sourceIdentifier);
        sendBroadcast(i);
    }
  1. Call the helper at the point where you want to trigger Paco.

    notifyPaco("myAppEventIDString");

Building an Experiment to listen for that Trigger.

  1. Go to the Paco admin screen
  2. Go to 'Administer Experiments/ Create New Experiment'
  3. For 'Choose Signaling Mechanism', select 'Triggered Signaling'
  4. For 'Choose Trigger', select 'Paco Trigger'
  5. For 'Source of Paco Action', enter the unique string you specified in the broadcast call for your event above
Clone this wiki locally