Skip to main content
All CollectionsGet started
Basic configuration
Basic configuration

How to set up Fresh Relevance.

Updated over 4 months ago

1. Set up your ecommerce system

You must provide us with details of your marketing website and the ecommerce system that you use.

To do this:

  1. Expand the User menu and go to Settings > Website Settings.

  2. Select Site Details.

  3. Enter your organization’s details in the form:

    1. Website Name
      The full name for your website, for use in reporting.

    2. Website Address
      The complete URL for your marketing site.
      The site must be currently active on the URL you provide.

    3. Additional Subdomains
      Any additional subdomains for your site that you want to be able to access in the Site Editor.

    4. Currency

      The currency you want your reporting to display in. This is normally the main currency of your ecommerce system.

  4. Select NEXT.

  5. Expand the Website eCommerce System drop-down menu and select the ecommerce system you use for your site, then select NEXT.
    We prefill the field with the ecommerce system we find at the URL you provided in Step 3. Select Back in your browser if you need to edit this.

  6. You see a popover informing you that the latest version of the Fresh Relevance script will be deployed to your site. Read the information, and select YES to confirm.
    If you’re unsure, contact Support.

Tracking script

You must install our script on all pages of the marketing website you specified during setup.

You don't need to remove any other scripts. There are two components that need to be added to a website to enable triggered messages, but only the first is needed for website personalization.


2. The tracking script

The tracking script must be added to all pages of your site. The script looks something like this:

<script async src="//d81mfvml8p5ml.cloudfront.net/[exampleID].js"></script>

This is an example script and should not be directly copied. You must ensure you use the script generated specifically for your account.

Script deployment options

The tracking script can be added to pages by modifying the source, typically the header or footer template that generates the pages. This is the method we advise you to use, as some browsers can block scripts deployed through tag managers.

If necessary however, you can use a tag manager to deploy the script to your site.

Instructions differ for the various tag managers you could choose, but as an example here are the details for Google Tag Manager.

JavaScript frameworks

The tracking script does not require a JavaScript framework and works on any reasonably modern browser. However, if we’re customizing the script to collect data from your website, this is easier if we can use a JavaScript framework.

Depending on your site and the amount of data we need to capture, there may be additional charges if we cannot use a framework for the data capture.

Supported JavaScript frameworks are:

  • jQuery

  • Prototype

  • MooTools

If you don't already have one of these frameworks on your site, it's easy to install jQuery.

You should choose a CDN-hosted version, so it's usually already in the browser cache.

Learn more in this third-party jQuery guidance article.

Single page applications

If your website is built as a Single Page Application, ask your site developers to add some JavaScript API calls to inform Fresh Relevance of important events and updates.

Event filters

You can configure Fresh Relevance to ignore page views using your test server or from your office, so test and support activity doesn't pollute your customer data.

Learn more in Event filters.

Additional purchase complete tracking

You might find that some visitors navigate away from your site as soon as they have completed a purchase; they don't wait for your purchase complete page to load. This means that our script may not get time to run and so doesn’t record the purchase, and we could mistakenly think the cart was abandoned.

To account for this, we have a backup mechanism that runs faster than our main script. This additional tracking ensures that every single purchase complete event is registered and buyers aren't sent cart abandon emails in error.

You must include the following tracking pixel on the purchase confirmation page of your ecommerce system.

Choose one of the following versions:

Standard version

<img src="//d1f0tbk1v3e25u.cloudfront.net/pc/[exampleID]/?e=[customer's email address]" id="__tms_pc" height="1" width="1" />

Merge the customer's email address into the placeholder [customer's email address] on your ecommerce system.

You must not include the brackets.

Include order number tracking (optional)

<img src="//d1f0tbk1v3e25u.cloudfront.net/pc/[exampleID]/?e=[customer's email address]&r=[order / reference number]" id="__tms_pc" height="1" width="1" />

Merge the customer's email address into the placeholder [customer's email address] and merge the unique order number or reference into the placeholder [order / reference number]on your ecommerce system.

You must not include the brackets. The order ID must be unique across all sites used in the same account.

Alternatively, this request can be made server-side on behalf of the user.

Examples

Python3 version

import urllib.request
import urllib.parse

data = {}
data['e'] = 'Email Address Here'
data['r'] = 'Order/Reference Here'
url_values = urllib.parse.urlencode(data)

url = 'http://d1f0tbk1v3e25u.cloudfront.net/pc/[exampleID]/'
full_url = url + '?' + url_values

data = urllib.request.open(full_url)

Merge the customer's email address into the placeholder Email Address Here and merge the order number or reference into the placeholder Order/Reference Here on your ecommerce system.

For this implementation, you must ensure that you have the https node package installed.

To install, run:

npm i https

Node JS version

const https = require('https')
const options = {
hostname: 'http://d1f0tbk1v3e25u.cloudfront.net/pc/[exampleID]/',
port: 443,
path: `?e=${email}&r=${ordernum}`,
method: 'GET'
}

const req = https.request(options, (res) => {
console.log(`statusCode: ${res.statusCode}`)

res.on('data', (d) => {
process.stdout.write(d)
})
})

req.on('error', (error) => {
console.error(error)
})

req.end()

${email} is the email variable for your customer’s email address on your ecommerce system.

${ordernum} is the order number or reference variable for your customer’s order.

PHP version (Curl)

$url = 'http://d1f0tbk1v3e25u.cloudfront.net/pc/[exampleID]/?e=' . $email . '&r=' . $ordernum;

$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_HEADER, 0);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);

$response = curl_exec( $ch );
curl_close($ch);

$email is the user’s email address on your ecommerce system.

$ordernum is the order number or reference.


Advanced option: Hide the email address in the Purchase Complete Image URL

If you don't want the customer's email address to appear in the HTML source of your purchase confirmation page, you can hide it. This requires some work from the web developers who manage your ecommerce site.

Use an alternative ID

If you have imported either an External ID (EID - for example, from your messaging provider/ESP) or Customer ID (CID) into Fresh Relevance, then the customer can be identified using this.

To identify the user using an EID , simply merge this value into the eid= parameter instead of e=:

<img src="//d1f0tbk1v3e25u.cloudfront.net/pc/[exampleID]/?eid=[customer's EID in your ESP]&r=[order / reference number]" id="__tms_pc" height="1" width="1" />

Similarly, a CID can be provided in the cid= field:

<img src="//d1f0tbk1v3e25u.cloudfront.net/pc/[exampleID]/?cid=[Customer ID]&r=[order / reference number]" id="__tms_pc" height="1" width="1" />

Encoded email

Another method is to use Base64URL encoding on the email address. This is a form of Base64 encoding that works on URLs.

You can try this with an online encoder. Learn more in the spec for Base65.

Once you've created a Base64 encoded version of the email address, you can use it in the following version of the script, using be= instead of e=:

<img src="//d1f0tbk1v3e25u.cloudfront.net/pc/[exampleID]/?be=[base64url-encoded version of customer's email address]&r=[order / reference number]" id="__tms_pc" height="1" width="1" />

As an example, if you're using Python on your webserver, you can encode the email address like this: import base64

encoded = base64.b64encode('test@example.com')

Encrypted email

Finally, you can also encrypt the email address using the RC4 encryption protocol. To do this, you need to specify a shared secret on the Fresh Relevance settings page, then use this key to encrypt the address using RC4 and then URLbase64 encode the result. There are some code samples below for this in some popular scripting languages.

Code samples - RC4 encryption

Here are some code samples to use on your web server.

These samples can be run from the command line for testing purposes.

You can also make use of our RC4 test page. To access:

  1. Expand the User menu and go to Settings > Security and Privacy.

  2. Select RC4 Encryption.

Once you've added the shared secret to Fresh Relevance and created an RC4 encrypted, URLbase64 encoded version of the email address, you can use it in the following version of the Purchase Complete image below, using ee= instead of e=:

<img src="//d1f0tbk1v3e25u.cloudfront.net/pc/[exampleID]/?ee=[rc4-encrypted-URLbase64-encoded version of customer's email address]&r=[order / reference number]" id="__tms_pc" height="1" width="1" />

Code samples - RSA encryption
Here is a code sample to use on your web server.

RSA encryption is available on the Enterprise module.

You need to create an RSA encryption key, learn how in RSA encryption.

A test tool is also available on the RSA Test page. This allows you to encrypt and decrypt for any given keypair to allow you to test external systems. To use the RSA test tool:

  1. Expand the User menu, and go to Settings > Security and Privacy > RSA Encryption.

  2. To open the RSA test tool, select Test RSA.

  3. Expand the Key to Use drop-down menu and choose the RSA encryption key you want to use.

Once you've created your RSA encryption key, you can use the following version of the Purchase Complete image below:

<img src="//d1f0tbk1v3e25u.cloudfront.net/pc/[exampleID]/?re=[rsa-encrypted-URLbase64-encoded version of customer's email address]&r=[order / reference number]" id="__tms_pc" height="1" width="1" />


3. Set or change your messaging channel

For the purposes of initial setup, if you’re using Fresh Relevance for triggered messaging, you just need to choose the messaging channel you use, for example, an Email Service Provider or SMS channel.

To do this:

  1. Expand the User menu and go to Settings > Triggers and Messaging integrations.

  2. Select Messaging Providers.

  3. Under Set up a new channel, expand the Service Provider drop-down menu and then select the provider you want to use.
    If your provider is not listed, select Integrated ESP.

  4. Select Next.

You’re taken through to the Settings area for your chosen provider.


Next steps

Did this answer your question?