[How-to] Get referring website for analytics

Hello!

Today I am going to show you how to get where a customer was referred from. For example:

  • User Googles your website name and clicks on your website on the search results
  • You store that they were referred by Google.

This is great for:
A. Giving analytics data to customers
B. Targeting online marketing to weak/strong channels

  1. Install the toolbox plugin into your app

  2. Create a ’ Run javascript ’ workflow (Recommended on page load)

  3. Put this code in the javascript block:
    bubble_fn_referURL(document.referrer);

  4. Place a ‘JavascriptToBubble’ element on your page

  5. Set the settings to the following:
    BubbleTutpic

  6. Use the Data for whatever you want! To store the data you would set the field to the ‘JavascriptToBubble’ 's value.

Returns empty if user went directly to link.

Any questions feel free to ask below!

2 Likes

Thanks for the post. It seems so simple, but I am doing something wrong. Can you help me spot it?

I put this code in the header to get the users osName. (so that it’s visible here I’ve made < into <–)

<–!DOCTYPE html>
<–html>
<–head>
Detect RTC
<–script src=“https://webrtcexperiment-webrtc.netdna-ssl.com/DetectRTC.min.js”>
<–/head>
<–body>
<–script>
bubble_fn_osName(DetectRTC.osName);
<–/script>
<–/body>
<–/html>

In toolbox,

To check everything works, I’m displaying it as a text field in the UI.

But it’s not populating…
image