Skip to main content

Installation

You can automatically load and install the client by placing a <script> tag in the <head> or <body> of your website’s HTML. The minified script can be found here in Unify.
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <!-- Your Unify JavaScript tag here -->
  </head>
  <body>
    <!-- Or here... -->
  </body>
</html>
Be sure to only initialize the client one time on your website.
Once added, there’s usually nothing else you need to do to start collecting intent data. The website tag will automatically start collecting both page views and user identifications.

Content Security Policy

If your site has a content security policy defined, you will need to modify two of the policy’s directives to permit the Unify client to load and function:
  • Add https://tag.unifyintent.com to the script-src directive
    • This allows your site to load and execute the script which installs the Unify client
  • Add https://api.unifyintent.com to the connect-src directive
    • This allows the Unify client to make requests to the Unify API
Here is an example content security policy definition. Yours will likely contain additional values beyond the ones defined here:
Content-Security-Policy:
  default-src 'self';
  script-src 'self' https://tag.unifyintent.com;
  connect-src 'self' https://api.unifyintent.com;

Additional instructions

If you’re using one of the tools below, you can follow the provider-specific instructions for that tool to install the website tag.
The Unify Intent website tag can be added using Google Tag Manager. This can be useful in certain situations, such as if you have lots of scripts on your website and prefer to manage them all in one place.Start by opening the Google Tag Manager console. Add a new tag by selecting Tags -> New. Click on the Tag Configuration section and choose the Custom HTML tag type.Copy the website tag script from the Unify settings page here and paste it into the HTML field. Once it’s added, click Save.
Lastly, be sure to enable support for document.write in the tag settings. This is required for the website tag to work correctly.For more information, see the official Google Tag Manager support docs here.
Webflow has a dedicated section for adding custom code to your website. From the Webflow dashboard, navigate to the settings for your website and then select the Custom code tab in the sidebar.Under Head code, paste the website tag script from the Unify settings page here in the text area. Be sure to create a new line between any existing code and the Unify script.
When you’re done, click Save and then publish your changes by selecting Publish -> Publish to selected domains in the top right corner.

Usage

Once the website tag is installed, the Unify Intent client will automatically start collecting events on your website. Most of the time, there is nothing else you need to do. If you’d like to manually trigger events in specific places on your website, you can do so by calling the client directly. When you include the tag in your HTML, you will immediately be able to access the client at window.unify (or simply unify since window is global).
Console
// Trigger a `page` event
window.unify.page();
unify.page();

// Trigger an `identify` event
window.unify.identify("[email protected]");
unify.identify("[email protected]");

// You can also pass standard Person/Company fields as a second argument
unify.identify("[email protected]", {
  firstName: "Jane",
  lastName: "Doe",
  company: { name: "Unify", domain: "unifygtm.com" },
});
As demonstrated above, you can pass standard Person & Company fields as a second argument to the identify method. See Field Mappings for all available fields.
For details on how this works and the available options, see Configuration.