Working with affiliate links
For customers that are franchises or multi-level marketing companies, it's common to want to use affiliate marketing in their outbound emails and SMS.
What is affiliate marketing?
Affiliate marketing is specifically the process where an affiliate (you and/or your business) earns a commission for marketing anotherβs products.
As it relates to digital marketing, affiliates are typically provided an affiliate link that they can share. When people click on that links and sign-up for the product or service, typically within a specific window of time, the affiliate receives a commission.
Affiliate marketing example
For example, DailyStory makes use of a two-sided affiliate marketing program: when a customer shares their referral URL and a new customers signs up, the new customer gets a discount and the referring customer receives a financial credit.
For example, here is the affiliate link for DailyStory:
https://www.dailystory.com/invite?friend=4933ca402181fcf4a5c94713daaa9921
The value 4933ca402181fcf4a5c94713daaa9921 is the affiliate identifier used to credit a sign up.
In most cases, sharing an affiliate link is simple: just include the affiliate link directly in your CTA for your email or SMS message. But for scenarios that are more complex, such as when you have unique affiliate links for certain users, you can still easily run affiliate marketing in DailyStory.
Setting up dynamic affiliate links
To setup dynamic affiliate links the first step is to create a custom field.
- Create a custom field for the affiliate id
A custom field that is available to be assigned to a contact. For example, we can create a custom field called affiliate_id:

In the above screen shot a new custom field named Affiliate Id was created. It is just a simple Text field and does not need to be configured as Indexed/Searchable. Once created we can also see the API name of the field, clicking it will copy it to your clipboard.
- Populate the value for the affiliate id
Next, we need to set the value for the contacts in the system that will be using the affiliate id. For example, contacts might have an affiliate id associated with the store or location or it may be geographically / regionally based.
Updating the affiliate id can be done manually for a small group, but using an import is an easier mechanism for a bulk update.
Use segments for affiliate identification
In most cases the people associated with affiliate links can be segmented. For example, a segment by store or state.
Export the segment, open the exported file, and add a new column affiliate id. Then save this updated file.
Next, re-import the updated file with the new column and map the affiliate id column to the affiliate id custom field:
ImportantWhen importing an existing segment to update data, the DailyStory Id column must be mapped to. The only other column needed is the affiliate id.
Once the import is complete, the contacts in the segment will have their unique affiliate id mapped to them.
Note, you can use this same technique if you want to create a unique affiliate code per-contact.
- Use the affiliate id in a URL
Now that the contact's have their affiliate id assigned to them, we can use the affiliate id in URLs. You'll want to utilize your own affiliate URL.
For example, to set the call to action (CTA) button in an email the affiliate URL can be set using personalization:
https://www.dailystory.com/invite?friend={{profile.c__affiliate_id}}
The same works for SMS URLs as well.
When the messages are sent the DailyStory personalization engine dynamically builds the URL for each recipient using each recipients assigned Affiliate Id. If you need any assistance setting up your affiliate link, please reach out to us directly.
Examples of dynamic affiliate URLs
Below are some examples of dynamic affiliate URLs. This assumes that a profile property, profile.c__affiliate_id, exists. For the purpose of these examples, we'll use a value of affiliate_123 as the value returned (but each affiliate id will be unique to each contact).
Affiliate IDs in the query string
The most common pattern is for the affiliate id to be part of the URL's query string:
https://exmaple.com/store?affiliate=affiliate_123
This is created as:
https://exmaple.com/store?affiliate={{profile.c__affiliate_id}}
This is the preferred pattern, because if the recipient does not have an affiliate id, this URL would still be valid:
https://exmaple.com/store?affiliate=
Affiliate IDs in URL segments
A less common patterns is for the affiliate id to be part of the URL segment:
https://exmaple.com/store/affiliate_123
This is created as:
https://exmaple.com/store/{{profile.c__affiliate_id}}
Generally this is considered a bad practice because if the recipient does not have an affiliate id it may cause a 404.
Best practices with affiliate IDs
A best practice when using affiliate IDs that are dynamically inserted into URLs is to use a default value. This prevents an accidental blank value from being used.
For example:
https://exmaple.com/store?affiliate={{@ profile.c__affiliate_id default="none"}}
If the recipient does not have a value in their profile, the URL becomes:
https://exmaple.com/store?affiliate=none
Frequently Asked Questions
What happens if the recipient does not have an affiliate id assigned to them?
If an affiliate id is not assigned to the contact, the URL won't include an affiliate id. Most affiliate URLs are designed to work with or without affiliate ids.
Can I assign a default affiliate id if the contact doesn't have one?
Yes, just rewrite the URL to use {{@ profile.c__affiliate_id default="west"}}. If the contact's affiliate id is missing, the value west is used instead.