Documentation

Getting Started
Gleam Updates
Capture
Competitions
Galleries
Rewards
Installation
Advanced
Integrations
Action Types
Guides

Custom Action Tracking

Our Custom Actions allow you to verify the completion of an action via a Javascript API tracking script. This allows you to build your own actions and fire the tracking when the user has completed them.

Applications that support Custom Action Tracking:

  • Competitions
  • Rewards

Uses For Custom Action Tracking

Typically Custom actions require manual tracking, whereby the user might answer a question. Using the Tracking script allows you to more reliably track when users have completed actions on your own site (or partner site).

Typical tracking uses include:

  1. Purchases
  2. Adding products to cart
  3. Signups
  4. Visiting specific pages
  5. Completing forms
  6. Reaching a certain status/reputation level
  7. Referring friends
  8. Using specific features

An example might be that you create a Custom action that can be completed by users who have fully completed their Profile on your site. You put the tracking script on the Profile page and trigger it when you know the profile has been fully completed, this way only users that have properly completed the task can be awarded the entries.

Setting Up The Custom Action

To use the Custom Action Tracking first you need to setup a Custom Action.

The Title and Description should explain to the user what they need to do, and also link them out to anywhre they need to go to complete the action.

You must give the action you are unlocking a name like Purchase, Signup, Lead or UserID. In this example we're using the tracking name VIP.

Each Custom Action should have a unique tracking name, otherwise you end up mixing up your tracking and letting users unlock multiple actions. For example if you had multiple VIP levels you might use VIP1, VIP2 and VIP3 with each worth more entries.

Installing The Tracking Script

The Custom action will generate a tracking script that you need to install on your website. The script is broken up into two parts.

Tracking Script

Tracking scripts are unique per campaign, they will contain the key of your campaign. You can see the key highlighted in the example script below.

<script>(function(d, t){
  var key = '**y2sB7**';
  var g = d.createElement(t), s = d.getElementsByTagName(t)[0];
    g.src = "https://gleam.io/"+key+"/trk.js"; s.parentNode.insertBefore(g, s);
}(document, "script"));
</script>

You should place this script into the of your website, or page that you want to trigger the Custom Action on.

If you have the Tab / Overlay installed for a campaign, we can also piggyback off that for tracking.

Action Trigger Script

The section part of the script is what you need to fire in order to unlock the Custom Action. This will also be provided during setup.

The script below will trigger the action with the Tracking name of VIP.

<script>
  var Gleam = Gleam || [];
  Gleam.push(['VIP', 'myValue']);
</script>

You can also replace myValue with your own custom value which will get passed back to Gleam:

<script>
  var Gleam = Gleam || [];
  Gleam.push(['UserID', '123456']);
</script>

Your custom value will show in the Details column in the Actions tab of your campaign.

This can be useful to help de-duplicate or show extra data, like which coupon a person used or perhaps what their UserID or OrderID is.

Full Script Example

Your full script on the page should end up looking something like this:

<script>(function(d, t){
  var key = 'y2sB7';
  var g = d.createElement(t), s = d.getElementsByTagName(t)[0];
    g.src = "https://gleam.io/"+key+"/trk.js"; s.parentNode.insertBefore(g, s);
}(document, "script"));
</script>
<script>
  var Gleam = Gleam || [];
  Gleam.push(['UserID']);
</script>

Firing this will then unlock the custom action assigned to VIP in the campaign y2sB7.

Enabling a Question Fallback

In some cases you may wish to enable a question as a fallback for your tracking. To do this simply select "Allow question or tracking" when setting up your custom action.

Then ask something that can be used to identify the user like username, orderid or name.

Useful Information

Auto Completion

The Custom action will periodically poll the campaign and auto complete when the user has unlocked the action, this means that it can be completed even if the user has left the campaign landing page.

Daily Entries

If you have the tracking set to daily it will expire any existing tracking and the user will have to fully complete the action the following day to get the daily entries.

Example

Here's a working example of the API unlock being used when a user visits a particular page.

API Tracking Example

Connect With Us