Doofinder logo

Support Documentation

Search icon

Integrate Doofinder Using GTM

Integrating Doofinder using the Google Tag Manager (GTM) allows you to manage your script without touching your site's HTML code.

To integrate it this way, follow these steps:

  1. Create your GTM account or log in if you already have one.
  2. Select the workspace where you're going to add the new script.
  3. create gtm account
  4. Select Add a new tag to configure Doofinder's script.
  5. add new tag
  6. On the next screen, provide the following:
  7. – A name for the new tag, for instance: "Live Layer Script".

    – Inside the tag configuration, ensure that the tag type is Custom HTML and paste your script for Doofinder inside the HTML editor, including the surrounding script tags.

    The term 'const' does not work in GTM, so it is necessary to modify the beginning of the Live Layer script as follows:
    const dfLayerOptions => var dfLayerOptions
    See the image below.

    choose the script

    – Then under Triggering, choose when the script must be activated. Note that the recommended option is All Pages. This way, Doofinder will be available on all pages.

    trigger all pages
  8. Once done, press Save and your HTML tag will be created.
  9. save your html tag
  10. Back in your GTM dashboard, press the Submit button in the top right corner.
  11. submit gtm
  12. Select Publish and Create Version, then provide a relevant version name and description for the records, choose the environment where you want to publish the changes and press the Publish button in the top right corner.
  13. publish and create version
  14. You will be able to see the details of the latest published version from the dashboard. The Doofinder Layer should be working as soon as the information reflects the latest version.

Did you find this page helpful?