This article walks you through adding the Evolv Experience Accelerator snippet using Google Tag Manager (GTM).
Table of Contents
Creating the Evolv tag in Google Tag Manager
- Open Google Tag Manager.
- Navigate to the Tags section.
- Click the New button.
- Name the new tag "Evolv Integration” and click the grey circle with a lego inside.
- For tag type, choose “Custom HTML”.
- Add the following code in the “HTML” section.Text version of the code in the above screenshot:
<script> var evolvEnv = '<EVOLV ENV ID>'; var evolvScript = document.createElement('script'); evolvScript.setAttribute('src', 'https://media.evolv.ai/asset-manager/releases/latest/webloader.min.js'); evolvScript.setAttribute('data-evolv-environment', evolvEnv); evolvScript.setAttribute('data-evolv-pushstate', 'true'); document.head.appendChild(evolvScript); </script>
- Under “Triggering”, select “All Pages”.
Previewing and publishing the changes
- In Google Tag Manager, select the PREVIEW option.
- Enter the website's URL when prompted.
- Enter the website's URL when prompted.
- Check for the Evolv tag in the Summary view of the Google Tag Manager preview tab.
- You might need to reload the website tab first.
- If you don't see the tag, check the tag settings and try again.
- If you do see the tag, there's a good chance the Evolv Experience Accelerator snippet is loading.
- Open the Developer Tools on the website page and go to the Elements tab.
- Search for "webloader" and find the script you added in the tag.
- You'll see two instances of the webloader:
- The first is the script you added to the tag itself.
- The second is the Evolv snippet that got added to the DOM after the tag was executed. Here's an example of what that looks like.
- Lastly, open the Network tab, add a filter for "evolv", then reload the page.
- Confirm you have the following network requests.
- If you don't see these requests, check the JavaScript in the tag you created.
- See Experience Accelerator Integration for help on what to include in the script.
- See Experience Accelerator Integration for help on what to include in the script.
- Publish the latest version of the container.
- Now that you're out of preview mode, check the website again.
- Confirm the script is present and the network requests are being made.