Skip to main content
Embed scripts put outside services on your site: a chat window, an analytics tag, an ad pixel, or any code a service hands you to paste. Pick the service and paste its code. Attract keeps your cookie banner and your policy pages in step with it. Who can do this: Admins and Owners. A script runs on public pages, so Editors and Contributors can’t add one.

Before you start

  • Get the code from the service you’re adding. Each code is unique to your account, so Attract never writes it for you. The steps below show where each listed service keeps it.
  • Decide where it should run: every page, or only some.
  • For a service that tracks visitors, such as an ad pixel, set up your cookie banner first. See Cookie consent.

Add a script

1

Open Embed Scripts

Open the command palette (⌘K, or Ctrl+K on Windows) and choose Embed Scripts. The shortcut is G then Shift+S (press G, let go, then hold Shift and press S, while you’re not typing in a box; see Keyboard shortcuts).
2

Start a new one

Choose New Embed Script. The editor opens on the Script tab.
3

Pick the service

On the Script tab:
  • Name: for your own reference, such as “Website chat”.
  • Service: the service you’re adding. The list is grouped by kind:
  • chat, such as Chat — Fetchski WebChat (recommended) or Chat — Intercom;
  • analytics, such as Analytics — Google Analytics 4 (Google tag);
  • Tag manager — Google Tag Manager;
  • ad pixels: Advertising — Google Ads (Google tag), Advertising — Meta Pixel and Advertising — TikTok Pixel.
For anything else, choose Custom — paste any embed code.
4

Get the code

For a listed service, a card named Getting the … code appears, such as Getting the Meta Pixel code. Follow its steps on the service’s own site and copy the code.
The Script tab with Service set to Advertising — Meta Pixel and the "Getting the Meta Pixel code" card open below it, its numbered steps and links visible.The Script tab with Service set to Advertising — Meta Pixel and the "Getting the Meta Pixel code" card open below it, its numbered steps and links visible.

Each listed service comes with steps for finding its code.

5

Paste it

Paste the whole code into Embed code, exactly as the service gave it. It usually starts with <script and ends with </script> (its script tags): copy those too.
  • For an ad or analytics service, an ID box appears too: Google Ads tag ID, Measurement ID, Container ID or Pixel ID. Leave it empty and it’s filled in from the code when you save.
  • Where on the page: keep Recommended for this service unless the service’s own steps say otherwise. This is where the code sits in the page’s hidden code, not where anything shows: the head is a hidden part that loads first, the body holds the page itself. A chat window still appears in its usual corner either way.
6

Describe a custom service

For Custom — paste any embed code only, fill in these fields. Your Cookie and Privacy policies name the provider and link to its policy.
  • Provider: the company behind the code, such as “Acme Chat Ltd.”
  • Provider domain (optional): just the domain the code loads from, such as acmechat.com, with no https:// and no page.
  • Provider’s privacy policy (optional, but expected): the full web address of the company’s privacy policy page, such as https://acmechat.com/privacy.
Separately, on the Legal tab, you can write your own wording for its Privacy Policy section and Terms section (both optional).
7

Check its consent

On the Consent tab, keep Consent category on Recommended for this service. Leave List its cookies on the Cookie Policy on.
8

Choose its pages

On the Pages tab, set Load on to Every page, Only the pages listed or Every page except those listed. List pages in Pages, one per line.
The Pages tab with Load on set to Only the pages listed and Pages holding "/contact" and "/book-a-visit/", Load order 50.The Pages tab with Load on set to Only the pages listed and Pages holding "/contact" and "/book-a-visit/", Load order 50.

Run a script everywhere, or only where you need it.

9

Save it

Choose Save. The script goes live on your site right away.

Page lists

In Pages, write one page per line:
  • /contact is that page only.
  • A * at the end means “anything after this”. So /blog/* is every blog post, but not the blog page itself. /blog* is the blog page and every post.
  • / is the home page only.
You can paste a full web address. Only the page part counts, and capitals and a trailing slash don’t matter.

What happens next

A script has no draft. It goes live as soon as you save. To take it off every page at once, turn off Enabled. Its settings stay. Your policy pages update by themselves:
  • The Privacy Policy and Terms and Conditions pages gain a Third-party services section for each listed service that’s on. Not every service adds to the Terms, but chat services do. The section sits below your own text and shows a Last changed date.
  • The Cookie Policy lists each cookie the service sets, in the cookie list. You can reword those entries.
  • Turning a service off removes its sections. Your own policy text is never touched.
When a save starts collecting new visitor data, your visitors are asked for consent again. You see this notice: “What this site does with visitor data changed, so the cookie policy version is now … and visitors will be asked again.”
Parker's Privacy Policy page at the Meta Pixel entry in its Third-party services section: provider, Marketing category and what Meta receives.Parker's Privacy Policy page at the Meta Pixel entry in its Third-party services section: provider, Marketing category and what Meta receives.

Your Privacy Policy describes each service while it's on.

Good to know

  • Scripts follow the cookie banner. A script in Analytics, Marketing or Functional runs only while a visitor allows that kind. Where visitors must opt in, it waits until they agree, and the service hears nothing about them before that. Where the banner is only a notice, it runs straight away and stops if they decline (How the banner works). A chat window appears the moment a visitor agrees, with no reload.
  • Choose Strictly necessary with care. A script in Strictly necessary runs for every visitor, with no way to decline. Use it only if your site can’t work without it.
  • With the cookie banner off, new visitors get only Strictly necessary scripts. Nobody can agree to the rest. A visitor who already made a choice while the banner was on keeps getting what they allowed.
  • A tag manager takes on what it loads. Google Tag Manager starts as Analytics. If your container also fires ad tags, set its Consent category to Marketing.
  • Some pasted code is left out on purpose. Many services add a backup part for browsers with JavaScript (the language scripts run in) turned off; it starts with <noscript>. Those visitors can’t answer the cookie banner, so Attract removes that part for you. You don’t need to do anything.
  • Animated page changes. Your site can move between pages smoothly. Some services and some custom code break when it does, so while one of those is on, your site uses ordinary page loads instead. If you know your custom code works with them, turn on Keeps working with animated page transitions on the Pages tab.
  • Fetchski WebChat has extra, optional fields on its Legal tab about the chat’s AI. They change what your Privacy Policy says about it. If you turn on Ask visitors to consent again when the AI changes, a change to the chat’s AI also asks every visitor for consent again.

Troubleshooting

You pasted only the inside of the code. Copy it again from the service, including the opening and closing script tags, and paste all of it.
Part of the code is missing, such as a closing tag. Copy the whole code again from the service and paste it in place of the old one.
You copied the no-JavaScript part only. Go back to the service and copy the main part of the code.
This code holds something that can’t go in the head, the hidden part of the page that loads first. Change Where on the page to one of the two Body choices (start or end), then save again. Nothing visible on your page moves.
Load on is set to Only the pages listed, but Pages is empty. Add at least one page, or choose Every page.
The script saves, but you see “The pasted code loads from …, not …”. The code probably belongs to another service. Check you picked the right Service, because your policies describe the service you picked.

Cookie consent

the banner that asks visitors first.

Conversion tracking

report bookings and leads to your ad platforms.

Legal details

the business details your policies use.

Cookie Declaration

show your cookie list on a page.