Adding a Code Snippet to Engaging Networks Pages
Some tools and services like cookie consent banners or analytics trackers require you to add a snippet of code to your Engaging Networks pages. This article walks you through the general steps for adding the code snippet.
Copy the Code Snippet
Log in to the service that provides the code snippet.
Locate the installation instructions. These usually include a small block of HTML or JavaScript code.
Copy the entire snippet.
Example:
<script src="https://example.com/widget.js"></script>
Adding the Code to Engaging Networks pages
Check the provider’s instructions for the recommended placement of the code. Most snippets need to be placed inside the HTML <head>
section, but others might go in the <body>
.
Snippets in the <head>
section must be added to a page template. Snippets added to the <body>
can be added to the template or can be added to a code block on individual pages.
Adding the snippet to a Template
Go to Pages > Components > Templates
Select
to edit the template where you want to add the snippet
Edit the HTML of the template. Some templates will open by default to the HTML while blueprint templates will require you select the Edit HTML option on the bottom left
Locate either the
<head>
or<body>
tags in the HTMLPaste the snippet in the correct location (between the opening and closing tags). Example:
<head>
<script src="https://example.com/widget.js"></script>
</head>
Save the template
The snippet will be added to all the pages that use that template.
Adding the snippet in a code block
Go to Pages > Manage Pages
Select
to edit the page where you want to add the snippet
Select which page you want to add the snippet (for example, you may only want the snippet on the last /thank you page)
Hover to the right to expand the page builder toolbar
Select Components > Code Block and drag and drop a code block onto the page
Paste the snippet into the code block
Save the code block
After installing, test your pages to ensure they are working as expected and also that the snippet is working as expected (cookie banner displays, analytics are being tracked, etc).