How a referral works
- The existing customer logs in and calls a page on which you have built in the referral link. The shop system encrypts their identifier and appends it to the link as a URL parameter.
- They pass the link on, through whatever channel.
- The recipient calls the link. The shop system decrypts the parameter, checks it and remembers the referrer in the session.
- The recipient places an order. The identifier and customer number of the referrer are added to the order data.
- The merchandise management system reads the order and starts its own refer-a-friend process.
The feature is available from release version 82 and does not need to be enabled. However, the transfer to a merchandise management or ERP system cannot be mapped via the WSP Manager; a connector module is required for this. Without this module, the shop does generate links and recognise referrers, but the information remains in the order data. Contact your WEBSALE contact person about the connector module.
Shop configuration
Add theTellAFriend section to the shop configuration shop.config. The following values correspond to the defaults.
Cookie and consent
If you setCookieDays to a value greater than 0, register the cookie as a WEBSALE service in the AgreementCookies section of the shop configuration shop.config.
Without consent, the shop system neither writes nor reads the cookie. The assignment of the referrer then continues to work, but only within the current session. If the visitor gives consent later in the same visit, the cookie is written retroactively.
Generating the referral link in the template
The referral link is an ordinary shop link with an additional parameter.TAF-Name returns the parameter name, TAF-Value the encrypted value. Both are assembled with the DC-CustomLink tags.
Because only logged-in customers can make recommendations, the link belongs in a bracketing with ST-LoggedIn. The following example attaches the link to the product detail view ws_product.htm.
The
{TAF-Value} bracketing applies exactly when a customer is logged in, and is therefore equivalent to {ST-LoggedIn} at this point. You can also bracket the block with TAF-Value instead of ST-LoggedIn if that reads better in the template. Both at the same time are not necessary.What happens when the referral link is called
The shop system takes thetaf parameter from the URL and checks it in several steps before writing the referrer into the session.
The self-referral case is checked twice: when the link is called and again immediately before the order is written. This also covers the case in which someone calls their own link while logged out and only logs in afterwards.
Where the referrer comes from
The shop system first looks for the referrer in the URL parameter. If there is nothing there, it reads the cookie, but only if there is no referrer in the session yet and consent has been given. The cookie is only renewed if the value came from the URL andCookieDays is greater than 0.
The referrer’s customer number is not in the link. The encrypted parameter contains the shop identifier, the internal customer identifier and a timestamp. The shop system fetches the customer number from the customer account as soon as it is needed.
How long the assignment applies
A recognised referrer applies to exactly one order. After a successful order, the shop system resets the assignment and deletes the cookie, even ifCookieDays provides for a longer lifetime. A second purchase therefore does not count towards the same referrer again unless a referral link is called again.
The order data
IfAllow = yes is set and a referrer has been recognised, the shop system writes two additional lines into the Order section of the order data.
Both lines always appear together or not at all. If no referrer has been recognised, they are missing entirely; no empty fields are written. Your merchandise management system should therefore check for the presence of the field and not for an empty value.
TAF-Name
Returns the name of the URL parameter via which the encrypted referral information is passed. The value is fixed and istaf.
Use
TAF-Name instead of hard-coding taf in the template. If the parameter name changes in a future version of the shop system, your templates will follow automatically.
Permitted in all templates.
TAF-Value
Returns the encrypted value that follows the parameter name in the referral link. It contains the shop identifier, the internal customer identifier of the logged-in customer and a timestamp. The value is hexadecimal-encoded and can therefore be used in a URL without further encoding. As a bracketing, the tag applies if a customer is logged in.The encrypted value is generated once per session and reused afterwards. All referral links of a session therefore carry the same value, regardless of which page they point to. After logging out, a new session begins and thus a new value.
Permitted in all templates.
TAF-IsSet
Applies if a referrer has been recognised in the current session, that is, if the visitor entered the shop via a valid referral link. Use it to show notices that only apply to referred customers.
Permitted in all templates.
TAF-UserIndex
Outputs the referrer’s internal customer identifier. As a bracketing, the tag applies if a referrer is set and thus behaves likeTAF-IsSet.
The tag is intended for troubleshooting. When testing a referral link, the output identifier lets you determine whether the correct referrer was recognised and look up the customer in the merchandise management system. The number has no meaning for shop visitors, so only output it in a comment or on an internal test page.
Permitted in all templates.
