Last modified January 21, 2019 by Shelly Wolfe

How do I send events with deeplinks?

This article provides examples of how to use deeplinks to send events. These examples show how to implement deeplinks both from within your app or by linking to your app from a partner app.

Implementing the below examples in your code enables your Swrve users to send events via deeplinks from in-app messages of the form: swrve://?event=<event name>




In the Unity SDK, it is important to set up the custom button listener when the SDK is initialized. This is done by adding the following code as the SDK is initialized:

The custom button listener is then included in:

By allowing your Swrve users to send custom events via deeplink, you can track which app users engaged with campaigns. This allows targeting of these users or linking of in-app message campaigns. It is also possible to expand this code for different key-value pairs to allow deeplinks to send user properties, purchases, and so forth.

Use case

The key use case for sending events via deeplink is enabling your Swrve users to link in-app message campaigns. In the following example, you can create a tutorial flow of messages in Swrve without any changes to your code—once your app is set up to send events via deeplink.

The first message can be triggered by any event, such as visiting the home screen, once the action is a deeplink which sends a custom event:

In-app message action deeplink

Subsequent messages can then be triggered by the event fired by the previous message:

Trigger event deeplink