The Ensighten Swift library in combination with the Ensighten Mobile Platform and Ensighten Mange can be used to track when your users open your app through a deep link or universal link. In addition you can further extract data from these links in order to track information like marketing ids, user information, or any other data passed through the URL.
In order to begin tracking deep links, you must first add support for these features in your app. You can follow this guide from Apple to enable Universal Links. And use this guide to enable Deep Links. Once you have set these up and implemented the methods in your AppDelegate, Ensighten will automatically hook into these methods and add lifecycle tracking events when these methods are called. No additional setup is needed in the app. All data about the url being opened will be passed to Ensighten Swift where any custom event code will be run and passed to the tag, which we will cover in the next section.
Ensighten Mobile Setup
- Login to manage.ensighten.com and navigate to the Mobile product using the switcher in the top left.
- Once inside the mobile product, click on your app.
- Next click "Add Event"
- On the next page select "Lifecycle Event" then select "Deep Link Opened".
- Press "Next" on the next step.
- Then press "Save & Commit"
- On the App Overview page publish your new event
- Switch back to Manage and go to "Tags" on the left
- Select "Add Tag"
- Inside the code editor insert this code:
new Image().src = "https://nexus.ensighten.com/debug/message.gif?deeplinkURL=" + Bootstrapper.getMobileToken("URL");
This is simply a debug function to display the captured URL when listening to your app through a proxy such as Charles. In this section you can take the URL and pull out any values you need and process them as necessary.
- In step 2 under "Tag Space" select the space you used to set up your mobile app.
- Select the events filter and find the deep link event you created in mobile.
- Save, commit, and publish your tag.
This tag will now fire when your deep link event fires. You can now use this workflow to track how your users open your app from deep and universal links.