HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideLegal TermsDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Create goals and track conversions

Describes how to work with goals and conversions using Optimizely Content Recommendations.

A goal is high-value action you want to track as users convert against it. You can create a goal using JavaScript. For example, an automotive website may deem the action of requesting a test drive as a high-value action, whereas a software company may deem the action of subscribe to newsletter as a high-value action. In either scenario, this goal is represented as a conversion within Optimizely Content Recommendations.

1434

There are two main uses of goals:

  • Analytics – Understand the aggregate interests of users who convert against a goal, such as topics that interest users who subscribed to a newsletter.
  • Measurement – How many users go on to convert against each goal after clicking on a content recommendation.

You can track conversions against a goal by tracking a conversion event, typically done in your tag management system (though goals can be hard-coded into your pages as well). Conversion events can be any action captured by website visitors – a form completion, a page view, a click on an element, etc. The goal itself captured is only a conversion event – no other information can be passed to the service for tracking such as transaction amount or custom attributes about the unique visitor.

📘

Note

The goal name can be up to 255 characters. If the goal does not already exist, it is created.

For example, you can record a conversion against the Subscribed to Newsletter goal:

<script>
    _iaq.push(['goal', 'Subscribed to Newsletter']);
    _iaq.push(['track', 'convert']);
</script>

📘

Note

The timing on when your goal tag is fired is crucial. Make sure that your Content Recommendations page tracking has fired on your page before the goal is registered. Tag sequencing assures that the site tracking tag registers first on the page before the event is captured.  See also: Tracking your Site.

Sample trigger for Booking Confirmation goal in Google Tag Manager:

1130

Sample tag script in Google Tag Manager:

961

Sample tag sequencing settings in Google Tag Manager:

941

📘

Note

You cannot manually remove goals from your dashboard. To remove goals, contact customer support and provide the name of your environment and the goal you want to remove.