awe.sm Conversion Tracking
Clicks are a basic measurement of performance. Conversion tracking allows awe.sm to know more about benefits that occur as a result of sharing. Together, you get a precise picture of the value from social media traffic, in how it contributes to page views, actual sales, and other business objectives.
When this performance data is combined with the intent data captured when a share action is created, awe.sm provides a deep understanding of the factors that contribute to the most optimal sharing behaviors.
Conversion goals are tracked in two ways: counts and values. Five conversion goals can be defined per project. Page views resulting from awe.sm link are also tracked using this API.
Getting Started
Step 1: Enable the conversion tracking feature. In your Project Settings, enter the domain names of the web sites where you want to track conversions.
Step 2: Add the awe.sm conversion tracking script to your website. This JavaScript library is available via HTTP and HTTPS, so we recommend using scheme-relative inclusion. It must be included on every page where you want conversions tracked—including the initial shared page, otherwise no conversions will be captured.
The awe.sm library can be loaded asynchronously to ensure your page renders as fast as possible.
<script type="text/javascript">
var AWESM = AWESM || {};
AWESM.api_key = 'XXXXXXXXXX';
(function() {
var js = document.createElement('script'); js.type = 'text/javascript'; js.async = true;
js.src = '//widgets.awe.sm/v3/widgets.js?key=' + AWESM.api_key + '&async=true';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(js,s);
})();
</script>
It can also be loaded directly. In many browsers, page rendering will pause while scripts are loaded, so we recommend putting script tags such as this one as close to the bottom of your markup as possible.
<script src="//widgets.awe.sm/v3/widgets.js?key=XXXXXXXXXX"></script>
Replace XXXXXXXXXX with your own awe.sm API key, found in Project Settings. Note: This script is the same as the one used to generate our Share Buttons, so if you use both, you only need to include the script once. Our share tools are also an easy way of generating trackable conversions.
That's it! Now, when users share links to your domain, we will automatically set a cookie on incoming visitors who follow those links and track their page views across your site (and only your site). If your goal is to quantify page views from social traffic, you're done!
Step 3: Register Goals
In addition to page views, you may also want to know the number of visitors who join your site, sign up for a newsletter, or purchase a product as a result of social sharing. After completing the above steps, use the AWESM.convert method included in the JavaScript library or call the conversions/new endpoint to register goal conversions.
JSAWESM.convert(goal,value)
Required Parameters
| Parameter | Type | Description |
|---|---|---|
| goal | string | Which of the five goals: goal_1, goal_2, goal_3, goal_4, or goal_5 |
| value | integer | The integer value of the conversion event. Because it is an integer, if you are specifying a precise dollar value, we recommend specifying the value in cents, e.g. $1.57 would be 157, $10 would be 1000. This does not have to be a dollar value — you can set any value and our APIs will sum the values for you. |
Related APIs
Examples
If you'd like to track when a new user joins your website as goal_1, this script would be placed on the successful user registration page:
<script>
AWESM.convert('goal_1',0);
</script>
Note: There is no monetary value to this conversion, so 0 is passed for the value.
If you'd like to count a user making a purchase for $3.50 as goal_2, this script would be placed on the order confirmation page:
<script>
AWESM.convert('goal_2',350);
</script>
All your calls for any individual goal do not need to have equal values, so you can call goal_2 with a value other than 350 for another conversion later on.
Retrieving Stats
Use the parameter with_conversions=true in the Stats API to retrieve conversion counts and values.
Last updated 2012-02-17
