Use Swrve’s Facebook ad-triggered campaigns to give customers a personalized and relevant onboarding experience after they install your app from a Facebook campaign. For example, depending on whether or not the user has already installed your app, take them directly to the app store first. When they open the app for the first time or return to the app after clicking your Facebook ad, display a custom in-app message to personalize their experience and improve conversion.

Using the new Swrve Amplify Facebook adaptor, you can also export updated Swrve user properties to a Facebook audience and send offline conversion events back to Facebook to measure the conversion performance of your ads.

Facebook Ad Journeys are currently only available as part of our Early Access program. If you would like to have this feature enabled for your app, contact your CSM at support@swrve.com.

Prerequisites

To create Facebook ad journeys with Swrve, you must first have a Facebook app and Facebook Business Manager account, with admin access to both.

Your development team must complete the following:

Integrate the latest Facebook SDK into your app and process deeplinks according to their instructions, including the required parameters detailed below. For more information, see the Facebook article, Deep Linking in App Ads.

Upgrade your app to Swrve SDK version 5.2 or later. Ensure you configure how you want to handle the deferred (new install) ad journey. For more information, see the instructions for deferred deeplink journeys below.

For exporting custom audiences and offline conversion events back to Facebook, we recommend logging advertising identifiers to help link Swrve users to a corresponding Facebook user profile. For more information, see How do I log advertising and vendor IDs?

Ad deeplink parameters

For Swrve to correctly process the customer journey when a user clicks your Facebook ad, your deeplinks should take a form similar to the following example. You can define the URL schema that you register in your app per your requirements (for example, swrve://myapp). However, for associated deeplink campaigns to load correctly, you must define the parameters as shown below.

URL parameters

The Facebook ad campaign name. Swrve uses this name to label the custom audience that is sent back to Facebook.

ad_content

The Swrve in-app campaign ID. When you create a new campaign in Swrve, the system automatically generates a campaign ID for that campaign. For example, https://dashboard.swrve.com/apps/[your_app_ID]/in_app_messages/123456.

When you create your Swrve in-app campaign or Conversation for an ad journey, you can copy and paste the deeplink URL from the campaign summary page.

Handling deeplink journeys in the SDK

After a user clicks your ad in Facebook, there are two possible journeys they will be directed through, depending on whether or not they have already installed your app. If they have not installed the app, they will be directed to the app store to download your app first. This is referred to as a deferred journey. If they have already installed the app, the app will open and display the customized campaign.

In your Swrve SDK integration, your development team must include the following methods to handle these two journeys.

Deferred journeys: Directs customers to the app store first

The following examples include options for if you only need to process Swrve deeplinks in your app or if you also need to process other deeplinks in your app.

//Inside your MainActivity that has a registered intent filter for deeplinks, call SwrveSDK handleDeeplink, typically from onCreate and OnNewIntent

publicclassMainActivity{

@Override

protectedvoidonCreate(Bundle savedInstanceState){

super.onCreate(savedInstanceState);

AppLinkData.fetchDeferredAppLinkData(this,

newAppLinkData.CompletionHandler(){

@Override

publicvoidonDeferredAppLinkDataFetched(AppLinkData appLinkData){

if(appLinkData!=null){

SwrveSDK.handleDeferredDeeplink(appLinkData.getArgumentBundle());

}

}

}

);

AppLinkData appLinkData=AppLinkData.createFromActivity(this);

if(appLinkData!=null){

SwrveSDK.handleDeeplink(appLinkData.getArgumentBundle());

}

}

@Override

protectedvoidonNewIntent(Intent intent){

super.onNewIntent(intent);

AppLinkData appLinkData=AppLinkData.createFromAlApplinkData(intent);

if(appLinkData!=null){

SwrveSDK.handleDeeplink(appLinkData.getArgumentBundle());

}

}

}

Setting up the ad journey campaign

After your development team have implemented the above, including upgrading to the latest Swrve SDK and publishing your app to the app store, you can start creating ad journey campaigns. There are two parts involved in creating these campaigns:

Create the in-app message or Conversation campaign in Swrve that you want to use to customize the user journey.

Create an ad campaign in Facebook and add the deeplink URL from your Swrve campaign.

You would likely set up these campaigns at the same time, as you need to reference the Facebook campaign name in your Swrve in-app campaign and then add the campaign deeplink URL to your Facebook ad campaign.

Step 3: In the Facebook campaign name box, enter the name of the Facebook campaign. This is simply the name you’ve assigned to the related Facebook campaign.

Note: You cannot use other audience filters or display triggers with ad journey campaigns. If you try to add additional audience filters, it will remove the Facebook external audience. By default, the campaign is displayed when the user opens the app.

Step 4: Select your campaign goals and save your campaign as you normally would. On the Preview & Test screen, under the campaign summary section, note the URL parameters that you must include in your Facebook campaign deeplink. For example:

Creating your Facebook ad campaign

Step 2: On the screen where you enter the text for your ad, under Deferred Deep Link, enter the deeplink URL from your Swrve campaign. For example:

Step 3: Optionally, test that the deeplink works using the Facebook App Ads Helper tool.

Step 4: Launch your Facebook ad campaign.

Once your ad is live, any users that click it will either be directed to the app store to install your app or sent directly to the app if it’s already installed on their device. When they open the app, the in-app message or Conversation campaign you created in Swrve will be displayed.

Exporting custom audiences and offline conversion events

Swrve Amplify now includes a Facebook adaptor that lets you export Swrve ad campaign audiences and offline conversion events back to Facebook. Once set up, Swrve exports the files to Facebook, who will try to link the data to a user profile using a common identifier, so we recommend logging advertising identifiers. For more information, see How do I log advertising and vendor IDs?

To use Facebook custom audiences and offline conversion tracking with Swrve, please review the relevant Facebook Terms of Service and then contact your CSM at support@swrve.com. You will need to provide the following information from your Facebook Business Manager account:

App ID – The Facebook App ID. To view the App ID for a specific Facebook app, on the app dashboard menu, click Settings, and then click Basic.

Ad Account ID – The Facebook Advertiser Account ID. To view the Ad Account ID, while still logged into Facebook Business Manager, go to the Ad Account Setup page.

Access Token – A non-expiring access token generated by Facebook for their Marketing API.
To create a non-expiring token, in your Business Manager Settings, set up a new system user for the associated app and ad account, and ensure you complete the following:

For the System User Role, select Regular System User.

After you create the new user, click Assign Assets, select Ad Accounts, and then assign the ad account in charge of your app to the new user.

On the same page, click Generate New Token, select the app you want to use, and give the new token all permissions.

App Secret – To view the App Secret for a specific Facebook app, on the app dashboard menu, click Settings, and then click Basic.

Exporting custom audiences to Facebook

When a user installs your app after clicking a Facebook ad, Swrve will update their user profile with the install details and daily exports a file of those users back to Facebook. The users are added to a Facebook audience called [Install/Reengage] Base [campaign_ID] [campaign_name], where the campaign_name is the same as the ad_campaign parameter included in the campaign deeplink. You can then use these audiences to retarget other ad campaigns in Facebook.

Exporting offline conversion events to Facebook

For Swrve to send offline conversion events back to Facebook, you must first create an offline event set in Business Manager. For more information, see the Facebook article, Create an offline event set. After your CSM sets up offline conversion event export for your app, anytime a user completes an in-app purchase (or other configured event) after clicking on a Facebook ad, Swrve will update their user properties with the purchase information and daily export a file of those users back to Facebook.

The most common event type that Swrve will send back to Facebook is in-app purchase events, however you can include other conversion events if required.