Skip to main content
All CollectionsManaging Your ProgramAdvanced Use
Generate Personal URLs (PURLs) using JavaScript
Generate Personal URLs (PURLs) using JavaScript
Britain Southwick avatar
Written by Britain Southwick
Updated over a week ago

To complete this process, you must have access to your website source code, be relatively comfortable with HTML (or have a developer that can help you).

What are PURLs?

Personalized URLs (PURLs) are links that users can send to friends however they want such as instant messaging, email or social networks.

Friendbuy widgets display a PURL when you pass Customer ID into the SmartPixel. This PURL will become available as soon as the widget loads, before the user shares.

If no Customer ID is detected by Friendbuy, but we receive an email address when the user shares, then we will use that email address to create and display a PURL. In this case, the PURL will not be available until after the user has shared and submitted their email address.

Your customer sees the same, share-able PURL every time they view the same widget.

There's even more flexibility available to you. PURLs match a Customer ID plus the particular widget they are viewing.

So your homepage widget ($10 referral offer) and your post purchase widget ($15 referral offer) have unique PURLs for the same customer. This combination of user + widget gives you more options to vary your offers and keep your reporting orderly.

Furthermore, if you A/B test a widget, the widget variation will match the offer and customer, too.

In sum, a PURL is defined by:

  • Customer ID or Email Address

  • Widget

  • Widget Variation

PURL Setup - passing the Customer ID into JavaScript to enable PURL display

In the SmartPixel code, you can find the placeholder where the Customer ID parameter may be passed into the JavaScript.

Step 1: Replace ‘CUSTOMER_ID’ with your Customer ID parameter. (PURLs are generated from the Customer ID, but since we're here, we'll pass in Email as well.)

Step 2: Clean up the code. Important: remove the “ //” that precedes the parameter. Here’s what it looks like before the clean-up.

Before:

After (view source in browser):

Here’s what a PURL-enable widget looks like without the detection of a Customer ID.

Here’s what a PURL-enable widget looks like with SmartPixel detection of a Customer ID.

Did this answer your question?