Track revenue generated by marketing campaigns

This guide will show you how you can easily start tracking revenue generated by your marketing campaigns to understand what channels are the most effective tools for you.

The UTM parameters

Moonbase supports tracking marketing campaigns using the well-known UTM parameters, also known as the Urchin Tracking Module. These parameters form a collection of identifiers to identify several dimensions of the channel where you attract customers. You've probably seen them as query parameters before, and Moonbase will track all of them for each purchase made:

ParameterPurpose
utm_sourceThe source site or channel of the campaign
utm_mediumThe type of link used, like ad or email CTAs
utm_campaignAn identifier for the specific campaign
utm_termSearch terms used by the customer to find the campaign
utm_contentDescription of what brought the customer to the site originally

In case you want to track which site lead to the conversion, Moonbase also supports an optional utm_referrer parameter, which can be used alongside the utm_source parameter. These parameters can be used both on our hosted purchase pages, as well as through the storefront APIs and SDKs. They can even be used for running targeted discounts, where discounts are exclusive for certain tracking parameters!

Hosted purchase pages

All merchants on Moonbase will have hosted purchase pages available, typically at URLs like https://demo.moonbase.sh/buy/demo-app. By adding the UTM parameters to these links, the eventual purchase will be tracked automatically by Moonbase, and any UTM targeted discounts will be automatically applied. Simply add the parameters as necessary to the URL: https://demo.moonbase.sh/buy/demo-app?utm_source=moonbase.sh&utm_content=docs. This page will also add the referrer domain automatically, to give you as much insight as possible.

Storefront API & SDK

If you are using our storefront APIs and SDKs, there's two endpoints where you should forward any UTM parameters to:

  1. GET /api/customer/storefront: This endpoint is used for fetching product pricing, and will have UTM exclusive discounts applied only if UTM query parameters are present
  2. PATCH /api/customer/orders/{orderId}: This endpoint is used for adding products to an ongoing purchase, and can also be used to add UTM parameters to the purchase

For more information about these endpoints, check out our storefront API reference. All of the above endpoints expect UTM parameters as query parameters as demonstrated in the above examples.

If you are already using our SDKs, all of this will be automatically handled as long as you link to your storefront with UTM parameters included. Check out our SDK documentation for Vue.js and React.js to get started.

Analyze in the Moonbase app

Once integrated, log in to your Moonbase account to find marketing analytics on the home page. Here, you can adjust time frames and investigate statistics for all the different UTM parameters:

Through these analytics, you'll be able to see trends across channels, based on quantity and total revenue.

Bonus: offer targeted discounts

You might find yourself in the position that some of your campaigns are doing better than others, and you would like to keep the best performing ones going. Often, those campaigns have specific discounts marketed in them, which is critical to the success of the campaign. Using our discount targeting, you can craft exclusive product discounts that apply only for purchases coming through certain channels:

Be aware that this is not a "secure" solution, since anyone could use the parameters to get the discount. If you want to ensure that the customer has right to the discount, consider targeting by products owned instead. This method utilizes our unique ability to correlate customer inventory with exclusive discounts.

Was this page helpful?