How to Add a Tracking Pixel Code to Squarespace (Step-by-Step)
To add a tracking pixel to Squarespace, go to Settings > Developer Tools > Code Injection and paste the pixel snippet into the Header field, then save and publish. This works for Meta Pixel,...
Quick Answer: Paste the Pixel in Code Injection
To add a tracking pixel to Squarespace, open your site's Settings, scroll to Developer Tools at the bottom, click Code Injection, and paste the pixel snippet into the Header field. Click Save, then publish your site. That's the whole process for most pixels.
This method works for Meta (Facebook) Pixel, Google Ads conversion tag, TikTok Pixel, LinkedIn Insight Tag, Pinterest Tag, and any other script that loads on every page. The Header field injects the code into the <head> section of every page, which is where tracking pixels belong.
Prerequisites Before You Start
- Your pixel code ready to copy — Get it from Meta Events Manager, Google Ads, TikTok Ads Manager, or whichever platform you use.
- Admin access to your Squarespace site — You need to be an owner or admin to see Developer Tools.
- A published site — Code Injection only works on live pages, not in preview mode.
- Your site must be on a paid plan — Code Injection is not available on the free trial or the Personal plan. You need at least the Business plan.
Step-by-Step: Add a Tracking Pixel to Squarespace
Step 1: Copy Your Pixel Code
Go to your tracking platform and copy the full JavaScript snippet. For Meta Pixel, this looks like a <script> block with your Pixel ID inside. For Google Ads, it's a conversion tag with your conversion ID and label.
Make sure you copy the entire snippet, including the opening and closing <script> tags. Don't just copy the Pixel ID number.
Step 2: Open Squarespace Settings
Log into your Squarespace dashboard. Click on the three dots icon (⋯) next to your website name, then select Settings.
If you're already inside the site editor, you can also click Settings from the left sidebar.
Step 3: Navigate to Developer Tools
In the Settings menu, scroll all the way down to the bottom. You'll see Developer Tools as the last section. Click on it.
If you don't see Developer Tools, you're likely on a plan that doesn't include Code Injection. Upgrade to Business or higher to unlock this feature.
Step 4: Click Code Injection
Inside Developer Tools, click on Code Injection. This opens a page with two text fields: Header and Footer.
The Header field injects code into the <head> of every page. The Footer field injects code just before the closing </body> tag.
Step 5: Paste the Pixel into the Header Field
Paste your tracking pixel snippet into the Header field. This is the correct location for most tracking pixels because they need to load early in the page lifecycle.
If you have multiple pixels, you can paste them one after another in the same field. Just make sure each snippet is complete and separated by a line break.
Step 6: Save and Publish
Click Save at the top right of the Code Injection page. Then go back to your site and click Publish to make the changes live.
If you forget to publish, the pixel won't load for visitors. This is the most common mistake people make.
How to Verify the Pixel Is Working
After publishing, open your live site in a browser. Right-click anywhere on the page and select View Page Source (or Inspect). Search for your Pixel ID or a unique string from your pixel code.
If you find it, the pixel is loading. If not, check that you saved and published, and that you're on a plan that supports Code Injection.
For Meta Pixel specifically, you can also use the Meta Pixel Helper browser extension. It shows whether the pixel fires on page load and whether it tracks events correctly.
Where to Put Different Types of Pixels
| Pixel Type | Best Placement | Why |
|---|---|---|
| Meta (Facebook) Pixel | Header | Loads early, tracks page views and events |
| Google Ads Conversion Tag | Header | Needs to fire on page load for conversion tracking |
| TikTok Pixel | Header | Standard placement for page view tracking |
| LinkedIn Insight Tag | Header | Loads on every page for audience building |
| Pinterest Tag | Header | Standard placement for conversion tracking |
| Event-specific snippets (e.g., Add to Cart) | Footer or Page-specific code | Only fires on specific actions, not every page |
Common Mistakes and How to Avoid Them
- Pasting only the Pixel ID — You need the full
<script>block, not just the number. - Forgetting to publish — Saving isn't enough. You must publish the site for changes to go live.
- Using the Footer field for page-view pixels — Footer works, but Header is the standard and safer choice for most pixels.
- Pasting the code in the wrong place — Make sure you're in Code Injection, not in a page's individual settings or a code block.
- Duplicating the pixel — If you paste the same pixel in both Header and Footer, it will fire twice, causing duplicate events.
- Not testing after publishing — Always verify with View Source or a pixel helper extension.
Limitations and When This Doesn't Apply
Code Injection is only available on Business, Commerce, and Enterprise plans. If you're on the Personal plan or a free trial, you won't see Developer Tools. You'll need to upgrade or use a different method.
Some pixels require server-side tracking (like Meta's Conversions API) to work around ad blockers and browser privacy restrictions. Code Injection only handles client-side tracking. If you need server-side, you'll need a third-party tool or a custom integration.
If your pixel code contains <script> tags that Squarespace's sanitizer blocks, you may see an error. This is rare, but if it happens, try wrapping the code in a <noscript> tag or contact Squarespace support.
What If You Have Multiple Pixels?
You can paste multiple pixel snippets in the Header field, one after another. Just make sure each is complete and separated by a new line. There's no limit on the number of snippets you can add.
However, be careful not to duplicate the same pixel. If you have a pixel from a previous installation, remove it before adding a new one. Duplicate pixels cause double-counting, which skews your conversion data.
Tracking Events Beyond Page Views
Most pixels track page views automatically once installed. But if you want to track specific actions — like Add to Cart, Purchase, or Lead — you need to add event code.
For Squarespace, you can add event tracking in two ways:
- Use Squarespace's built-in integrations — Some platforms (like Meta) have native Squarespace integrations that handle events automatically.
- Add custom event code — Use Squarespace's Code Blocks or Advanced settings on specific pages to fire events when users click buttons or complete forms.
If you're not comfortable writing JavaScript, stick with page-view tracking first. You can always add event tracking later.
FAQ
Do I need a paid Squarespace plan to add a tracking pixel?
Yes. Code Injection is available on Business, Commerce, and Enterprise plans. The Personal plan and free trial don't include this feature.
Can I add a tracking pixel to a specific page only?
Yes. Instead of Code Injection, go to that page's Settings > Advanced > Page Header Code Injection. This adds the pixel only to that page.
Will the pixel slow down my site?
Tracking pixels are lightweight and load asynchronously, so they have minimal impact on page speed. However, adding too many pixels can add up. Keep only the ones you actually use.
How do I remove a tracking pixel from Squarespace?
Go back to Settings > Developer Tools > Code Injection, delete the snippet from the Header field, click Save, and publish. The pixel will stop loading immediately.
What if my pixel doesn't show up in View Source?
Check that you saved and published. Also confirm you're on a plan that supports Code Injection. If it's still missing, try clearing your browser cache or using an incognito window.
Can I use Code Injection for Google Tag Manager instead of a single pixel?
Yes. Paste the Google Tag Manager container snippet into the Header field. Then you can manage all your pixels and tags from within GTM.
Does Squarespace support Meta Pixel natively?
Squarespace has a built-in Meta Pixel integration in some plans, but Code Injection is the most reliable method for full control. Check your Squarespace settings for a native integration first.
Further reading and comparison sources
These external sources provide additional context for evaluating the topic. Their inclusion is not an endorsement.
How SeaText Can Help
SeaText's AI agents can help you get more from your Squarespace site after you've installed your tracking pixel. The Conversion Relay (CAPI) agent forwards 100% of real purchases directly to Meta and Google's Conversions API, which works even when ad blockers or browser privacy settings block client-side pixels.
The Intent Amplifier sends high-intent buyer signals to ad algorithms, helping your pixel data work harder. And the Bot Protection Agent can recover up to 20% of wasted ad spend from bot clicks.
To use SeaText, you need an account linked to a single primary URL. If you have multiple domains, create separate accounts for each. The installation process is secure, and the AI remains inert until you activate it.