Click to edit the campaign from the Campaigns page.
Click the Success tab, and ensure either the Confirm or Close option is selected.
Note: it is not possible to add conversion script(s) to campaigns when the Redirect option is chosen.
Create Your Tracking Script
The general format of the script you need looks like this:
ga('send', 'event', [eventCategory], [eventAction], [eventLabel], [eventValue]);
Suggested usage is as follows—adapt as necessary to suit your own requirements:
- Set this to Leads
- Set this to Opted in
This is optional, but allows you to drill down and potentially see the number of leads from each optinopoli™ campaign.
Tip: use the placeholder [[campaign_name]] in place of your campaign name—where used, we will dynamically swap this for your campaign name when the tracking script is called. This means for example the names of campaigns can be edited, as well as duplicating and split testing campaigns, with the campaign names in your tracking data automatically kept in sync.
- This is optional, but could for example be used to reflect the average value of each new lead to your business.
A tracking script snippet is shown on this page with the values above (except eventValue), ready for you to copy and paste if required.
For more detailed information on event tracking, see Google's Event Tracking guide (suitable for developers)
<script> ga('send', 'event', 'Leads', 'Opted in', '[[campaign_name]]'); </script>
Add Tracking Script
Add your tracking script to the Conversion script(s) field.
NOTE: It is important to include the <script> tags for each script you include in this field.
Save the campaign.
Add a New Goal
What you have set up so far means that new leads will start registering as Events within your Google Analytics account.
However, there's a bit more work to do so they can start registering as conversions. To do this, you need to set up a new goal via your Google Analytics account as follows:
- Add a new goal via the Admin page—navigate to the required View, and select Goals from the View column.
- Click to add a new goal, and set it up as follows.
- Choose the Custom option and click Continue
- Enter Lead Capture - optinopoli as the Name, click the Event option and click Continue
- Fill in the goal details so the details match your event tracking code above. The example assumes you have a different label for each campaign, with no assigned value. Adjust as required and click to save.
Verify It's Set Up Correctly
As new leads come in, check to see if the conversions are registering in Google Analytics (Conversions > Overview).
If everything has been set up correctly, you should start to see new leads showing as goal completions. Note you may need to wait a few hours for results to show.
If not, double check all your settings above and try again.
Note: if you're adding conversion tracking for an existing campaign that's being split tested, remember to add the tracking script to the variations too.