Skip to main content

Copying a campaign across Applications

You can copy campaigns from one Application to another. For example, you can copy a campaign from your sandbox environment to a live Application once you have completed your testing phase.

To copy a campaign to another Application, rely on the Management API:

  1. Get the ID of the source and target Applications and of the campaign involved. You can find their ID by opening them in the Campaign Manager and looking at the URL.

  2. Get the details of the campaign you want to copy with the Get campaign endpoint.

  3. Copy the response payload into a text editor and apply the following modifications:

    1. Delete campaignGroups.
    2. Delete activeRulesetId.
    3. Set state to disabled.
    4. (Optional) Update the name of the campaign using the name property.
  4. Send a request to the Create campaign endpoint using the ID of the target Application, and the modified campaign details from the previous step.

    The campaign is created in your live Application, but disabled and it doesn't contain rules at this point.

  5. Use the List rulesets endpoint on your source campaign to display its rules' details.

  6. From the response, copy the ruleset with the latest timestamp from the data array.

  7. Create the ruleset in the target campaign using the Create ruleset endpoint:

    1. Paste the copied ruleset into the query's rules array.
    2. Add the "activate": true property at the root of the payload (at the same level as rbVersion) and send the request.
    Example
    {  "rules": [      {          "title": "25% off",          "condition": [            ...          ],          "effects": [              ...          ]      }  ],  "bindings": [],  "rbVersion": "v2",  "activate": true}

The source and target campaign are identical. When ready, you can activate the campaign.