1. Home
  2. Integrations
  3. Drift
  4. How to Integrate Drift Chat into PathFactory Experiences

How to Integrate Drift Chat into PathFactory Experiences

Drift is a cloud-based solution that helps businesses automate sales, support and marketing processes by adding live chat windows to websites. You can add Drift chat functionality as an overlay to any of your PathFactory Standard Experiences.

How to Add Drift to a PathFactory Standard Experience

To implement Drift, you will need to add an external code snippet to a PathFactory Experience. Below are the detailed steps to do so, along with a few customization options.

  1. Locate and copy your Drift code snippet. You can find detailed instructions on this in this Drift Knowledge Base article.
  1. In your PathFactory instance, click on the gear icon at the top right of the page and select External Code from the menu.
External Code menu item
  1. In the window that appears, click + Add External Code
Add External Code button

  1. Name your code snippet (for example, Drift Bot Email Address Capture).
Add External Code popup menu

  1. In the space provided, paste the Drift code referenced in Step 1.
  2. Next, paste the following script before the closing script tag (</script>). By adding this code, if a visitor provides their email address during the Drift conversation, PathFactory will record the email address in our reporting and create a known visitor record.
window.drift.on("emailCapture", function(data) {
  console.log("user identified as: " + JSON.stringify(data));
          conversionUrl: document.location.href,
          referrer: document.referrer,
          email: data.data.email,
          lookbookExternalForm: true
        }, "*");
  1. Click Add External Code to save your new code. 

How to Activate Drift in PathFactory Experiences

Once you have set up the external code for Drift within PathFactory, you can then activate Drift in your PathFactory experiences. If you enable the external code snippet globally, you are specifying that every PathFactory Standard Experience will have this chatbot.

To control and include Drift only in specific PathFactory Experiences where you want it to appear, add the external code snippet on an Experience by Experience basis. Navigate to the Standard Experience on which you want to deploy Drift. With that Standard Experience open, follow these steps. 

Step 1: From the settings menu on the left-hand side, click External Code.

Step 2: Select your Drift code snippet from the dropdown menu to add it to this Experience.

Step 3: Click Update.

Adding External Code

How to Avoid Having Two Drift Bots In a PathFactory Experience

If you have Drift deployed on a web page that is used in a PathFactory Standard Experience, and you add Drift to that Experience, you may see two Drift bots when that web page is displayed because you have Drift applied in both PathFactory and the website page. 

There are two ways to prevent this duplication.

Option 1: Add a short script to your website to suppress the web page’s version of Drift when it is shown in a PathFactory track.

Option 2: Add a code snippet in PathFactory to suppress the PathFactory version of Drift when a web page with Drift is shown.

We’ll help you decide which option is best for you. It may depend on how your Drift playbooks differ in PathFactory tracks vs. on your website. For example, your content track might be targeted towards the bottom of the funnel audience but the playbook used on your website is more top of the funnel. In this case, you may wish to use a bottom of funnel playbook for your PathFactory Experience and have it override your website’s top of the funnel playbook. Contact your CSM for guidance and support. 

Updated on August 21, 2023

Was this article helpful?

Need Support?
Can't find the answer you're looking for? Don't worry we're here to help!