This article is about Optimizely Classic. If you're using Optimizely X, check this article out instead.
Optimizely Classic Mobile
This article will help you:
Track conversions in your mobile experiment so you can determine which variation won
Create and track tap goals, view goals, and custom events (including revenue)
Remove goals from an experiment or delete them entirely
Measuring success of your mobile experiment and tracking conversion events is easy with Optimizely. This article will help you set up and manage your experiments’ goals.
In the Editor, click the Goals icon next to the experiment Start/Pause button:
This will bring up a list of the experiment's current goals. Web goals include engagement, clicks, and pageviews. Mobile goals include taps and views. You can track custom events (including revenue) across both of these platforms, as long as they're implemented both on your site and in your app.
To create a goal, click the Create a New Goal button in the Experiment Goals dialog.
The Create New Goal dialog will then appear. The default goal type is a custom event. If you'd like to change the goal type, select it from the Goal Type drop down menu.
For mobile experiments, there are three main types of goals: taps (iOS and Android), views (iOS and Android), and custom events (iOS and Android). Revenuetracking (iOS and Android) is a special type of custom event. Let's take a closer look at each!
In order to create and track goals, the Optimizely SDK must be installed in your app. If you haven’t yet installed the SDK, please refer to our handy Getting Started Guide for mobile Optimization.
In addition to SDK installation, your app must be connected to Optimizely in order to create tap and view goals. You can add Custom Event goals without connecting to the Editor. Now, we’re ready to manage and create goals!
Tap Goals (iOS and Android)
Optimizely records a conversion for a tap goal every time a user taps a view on your page. Optimizely dynamically tags each view on each element in your app so visual edits can be made and events can be tracked. As long as Optimizely is able to detect and tag the view, Optimizely can detect when taps happen on that specific view. You will see the goal appear as viewId in the goal modal once the goal triggered is detected.
For all goals, Optimizely counts an event that is triggered twice within five seconds as a single conversion. This measure prevents double-counting of accidental conversions. So, if an impatient user taps a button multiple times while waiting for a new view to load, you don't have to worry.
Let's create a tap goal that tracks taps to the Sign In button of our app.
1. Select Create a New Goal on the Optimizely mobile experiment page. The CreateNew Goal dialog will appear. Select Tap as the goal type.
2. Create your tap goal through one of two methods:
Tap the Device Screenshot
On the device screenshot in the Create New Goal dialog, tap the desired event in your app. Here, we want to track sign-in taps, so we tap the Sign In button.
Use the View Selector
Alternatively, you can use the View Selector to set up a tap goal. Click View Selector at the bottom of the device screenshot and select the desired element.
3. Your tap event should now appear automatically for tracking in Optimizely.
4. Add a descriptive name for the goal and click the Create button. (Or, if you are editing is an existing goal, click the Save button.)
5. This tap goal is now added as an experiment goal.
6. Once you’ve started your experiment, this goal will appear on the Results page as its own goal module. You’ll be able to investigate the results for each goal through three powerful, complementary metrics: Uniques, Totals, and Lifecycle.
View Goals (iOS and Android)
Optimizely records a conversion event for a view goal every time a certain view appears. Unlike tap goals, which track smaller elements such as buttons and images, view goals track top-level views such as screen views.
When might you want to set a view goal?
When a user action that is not a tap, such as a swipe, results in a new view that you want to track.
When tap goals may not accurately capture of the frequency of a conversion event due to the prevalence of user failure, such as form submissions that contain required fields.
Let's create a view goal. Instead of tracking the sign-in tap, which would capture all failed user login attempts, let’s simply track views of the screen that appears after a successful login.
1. On the Create New Goal dialog, select View as the goal type.
2. On your mobile device or Simulator, navigate to your desired view. For this goal, we want to track the view that appears immediately after a successful sign-in.
3. Back in Optimizely, your view should now automatically appear as a tracked event.
4. Add descriptive name for the goal, and click Save.
5. The view goal is added as an experiment goal.
6. Once you start your experiment, this view goal will get its own goal module on the Results page, where you can dig in and gain a rich understanding of your users' behaviors. To learn more, read about our Mobile Results page.
You can use the custom events goal to track events and behavior other than taps and view changes. To do this, you will need to implement code directly into the appropriate View Controller file. After taking just a bit of time to learn the basic procedure for setting up a custom event, subsequent custom events should be much easier to implement. You’ll gain powerful flexibility in adding goals that are meaningful to you.
A few examples of custom events are:
Deleting a task with a swipe
Completing a purchase
For details on how to track a variety of custom goals, check out goal tracking in our developer docs for iOS and Android.
Revenue Tracking Goals (iOS and Android)
The most popular custom event goal is revenue tracking for an experiment’s variations. Revenue needs to be added as a separate goal to be tracked properly. To make this easy, we’ve created a special saved Revenue goal.
Let’s walk through the process for adding revenue as a goal.
1. In the Experiment Goals dialog, click Add a Saved Goal.
2. Hover over the Total Revenue module. Click the Add button.
3. The revenue goal has now been added to your experiment.
4. In order to actually collect revenue data from your app, you also need to implement the goal in the appropriate location of your app’s code.
Insert the following revenue tracking code within the appropriate ViewController file for your app. If you don’t know where to this file, check with a development expert on your team.
[Optimizely trackRevenue:(NSNumber *)];
Refer to our Mobile Developers Guide (iOS or Android) for more details on Revenue Goal implementation.
Sharing, Removing, and Deleting Goals
It's easy to share common goals across different experiments in the same project, without having to recreate them. To add a goal that you've already created, click Add a Saved Goal. This will bring you to a list of your saved goals. Mouse over any of the goals in the list and choose Add to add it to the experiment you're editing.
You can remove a goal by clicking Remove when you hover over the goal on the Results page or in the Goals dialog. "Removing" a goal only removes the goal from one experiment. The Delete button removes the goal from ALL experiments and past data collected for that goal will no longer be visible. The Edit button allows you to edit the selected goal.