CartHook
CartHook and Fairing integration.
Follow the below steps to set up Fairing post-purchase survey on your CartHook order confirmation page. CartHook recently launched a native Shopify integration that does not require this custom setup.
Step 1: Enable the CartHook integration
In your Integrations tab, select connect to access your survey script. To note, you'll need to be on the Fairing Pro plan to enable this integration.
![CleanShot 2021-11-18 at 15.33.27@2x.png 1504](https://files.readme.io/0cf4ae7-CleanShot_2021-11-18_at_15.33.272x.png)
Step 2: Copy your Fairing installation code
After you enable your CartHook integration, you'll be presented with your installation code. Copy this code as you'll need it for step 3.
![9541d2d-carthook_installation_script.png 1656](https://files.readme.io/a4176d1-9541d2d-carthook_installation_script.png)
Step 3: Paste Fairing installation code into CartHook Global Code
To access the Global Code page in your CartHook account, click the menu button on the top right and then "Global Scripts."
![carthook_global_code.png 672](https://files.readme.io/ded66be-carthook_global_code.png)
On the Global Code page, scroll down until you find the "Thank You page scripts" section and paste the Fairing installation code into the input box.
![thank you page scripts.png 653](https://files.readme.io/e677650-thank_you_page_scripts.png)
If you have multiple scripts in this section, you'll need to edit our script due to how CartHook processes their Global Scripts. Use the below script and copy and paste the enquirelabs.com URL from your script in line 3. More information in CartHook's docs here.
let script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'PASTE URL FROM ENQUIRELABS SCRIPT HERE';
document.getElementsByTagName('head')[0].appendChild(script);
script.onload = function() {}
Step 4: Add survey script to thank-you page
If you're using CartHook's default confirmation page, this step may not be needed.
In your CartHook account, head to Funnels and click the funnel you're looking to add your Fairing post-purchase survey on. Next, click "Thank You Page" then "Edit Page."
![edit carthook funnel.png 2468](https://files.readme.io/4069ac6-edit_carthook_funnel.png)
On the following page, click </> to access the HTML of your confirmation page.
![edit html on confirmation page.png 2486](https://files.readme.io/219f491-edit_html_on_confirmation_page.png)
Insert the below code after line 8.
<div data-ch-type="text" data-post-purchase-survey></div>
![example div location.png 1788](https://files.readme.io/fd66a95-example_div_location.png)
Updated about 2 years ago