Tracking Coupon Codes
Tracking coupon codes is a great way to understand the effectiveness of your marketing campaigns. With Hyros, you can track coupon codes entered by customers on your website in 2 ways, depending on how the coupon code is applied.
Adding coupon Codes to your URL
Hyros can track coupon codes entered as UTM parameters in the URL.
However, this method may not work for all cases, such as when a coupon plug in does not send the coupon code in the URL itself, or if they do but send it to a URL which we can not track.
Shopify checkout pages are a common example, as these pages don’t always allow our universal script directly on them (depending on the theme and custom setup of each business).
To track this way, you MUST be including the coupon/discount code inside the URL of a tracked page during the lead’s journey. Here is an example:
If the coupon code is not in the URL, Hyros can still capture it from the input field with the hyros-coupon
class, as described in the following section.
If you do have the coupon/discount code entered in the URL, you can follow this guide to set up the URL rule to track it:
Tracking Discount Codes with a URL rule
Use this guide to understand how to track coupon codes when you add a discount code to the URL
1. Find out what the exact UTM parameter is that you use to add the discount code in your URL. For example here it is “discount”
2. Go to “tracking” then “URL rules” or follow this link: https://app.hyros.com/tracking/url-rules
3. Click “Add new rule”
4. Click “Dynamic Rule”
5. Click the “URL Rule Name” field. Enter a name here such as “discount” or “discount code”.
6. Click the “Enter the URL parameter to match” field and type in the UTM parameter you found in step 1 for your discount code. For example in this case I would type “discount”.
7. Then select “Enter” to ensure the URL parameter is added correctly
8. Click “Action” under “select Tag type”
We advise tracking this is an action rather than a source because tracking discount codes as a source may get in the way of attribution for other organic sources.
Action tags will still allow you to create reports based on these specific users, which will be explained later.
9. Click “Create rule”
10. Moving forward Hyros will create a “!action” tag based on what ever comes after “discount=”. In the example above, the tag created will be “!MAIL20” to signify the specific discount code they came from in your reports
Adding Coupon codes to the HTML
Please take in mind that in order for this method to work you MUST:
- Be able to edit the discount field code on your site
- The input must be outside of an Iframe and on a tracked page (aka a page with our universal script attached) so we are able to track field.
You will need to find the input field where users enter the discount code, here is an example:
In order for Hyros to identify the coupon input, you need to add the hyros-coupon
class to the input
field. This can be done by editing the HTML of the coupon input.
For example, the input
field may look something like this:
<input type=”text” placeholder=”Enter your coupon code”/>
You would add the hyros-coupon
class inside the <input/>
tag like this:
<input type=”text” placeholder=”Enter your coupon code” class="hyros-coupon"
/>
Test your Tracking
Go through the funnel as if you were a lead with a discount code. Enter the discount code and make a test Purchase.
You should see your purchase inside sales data with the !action tag corresponding with your discount code in the lead journey.
How to use the tag in your reports
We advise creating action tags for the purposes of discount codes to avoid any issues with taking attribution from other organic sources. However that means to use these tags in your reports the process is slightly different.
When loading a report, click advanced options and find the “Filter leads with tags” filter and enter the tag you have created for your coupon code there.
This will generate a report based on leads who at some point in their lifetime received that tag, which would allow us to view sales and other events that this specific group of leads made in your report and understand which sources they came from, and at the same time ignore any information from other lead’s who never received that tag (in other words leads who never used that discount code).