Magento Customer Retention Extensions
How To
Magento Customer Retention Extensions

How to use Drift Chat Magento 2

Log in to your Drift Account and download your chat code snippet

Using either Google Tag Manager or copy the JavaScript code to your header section in admin by going to Content -> Design -> Design Configuration -> Edit -> Default Store View -> Footer -> Miscellaneous HTML

Drift Chat Widget Will Not Display on My Magento 2 Store

To prevent card skimmers, session hijacking, clickjacking and more, the latest (Magento 2.3.5, 2.4.0) comes default will Content Security Policies (CSP) enabled. Content Security Policies are a powerful tool to mitigate against Cross Site Scripting (XSS) and related attacks and more. Web servers send CSPs in response HTTP headers (namely Content-Security-Policy and Content-Security-Policy-Report-Only) to browsers that whitelist the origins of scripts, styles, and other resources. Together, CSPs and built-in browser features help prevent:

Learn more about Content Security Policies / CSP and Securing Drift on your Site

To get Drift to display on your site you will need to add their domain allow list policy (like script-src, style-src, font-src and others) by adding a csp_whitelist.xml to your custom module’s etc folder.

csp_whitelist.xml

<?xml version="1.0"?>
<csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp:etc/csp_whitelist.xsd">
    <policies>
        <policy id="script-src">
            <values>
                <value id="custom-csp-drift-js" type="host">https://js.driftt.com</value>
                <value id="custom-csp-drift-widget" type="host">https://widget.drift.com</value>
            </values>
        </policy>
        <policy id="frame-src">
            <values>
                <value id="custom-csp-drift-js" type="host">https://js.driftt.com</value>
                <value id="custom-csp-drift-widget" type="host">https://widget.drift.com</value>
            </values>
        </policy>
        <policy id="media-src">
            <values>
                <value id="custom-csp-drift-js" type="host">https://js.driftqa.com/</value>
            </values>
        </policy>
    </policies>
</csp_whitelist>
Related

Magento 2 Extensions

Get more from your Magento2 store!

Catalog Hover Image for Magento

Quickly previewing alternative product images on your category list page.

Enhanced Transactional Emails

Get more from your order confirmation emails by promoting other complementary products.

Order Shipment Tracking

Providing your customer with a beautiful and functional order package tracking without leaving your site.