Adding Custom Code to Your Site
Extend your Exposure site with custom JavaScript, CSS, and HTML.
Overview
Section titled “Overview”Exposure’s Developer Options allow you to inject custom JavaScript, CSS, and HTML into your site. This gives you the flexibility to add analytics tracking, custom styling, third-party integrations, and more.
Accessing Developer Options
Section titled “Accessing Developer Options”-
Go to Settings from your dashboard
-
Click Developer Options in the left sidebar
-
Scroll to the Custom Code section
Code Injection Points
Section titled “Code Injection Points”There are three locations where you can inject code, each loading at a different point in your page:
Head (Early)
Section titled “Head (Early)”Code placed here loads immediately after the head tag opens—before any other scripts run.
Best for:
-
Cookie consent managers
-
Compliance scripts (GDPR, CCPA)
-
Anything that must load before other scripts
Head (Late)
Section titled “Head (Late)”Code placed here loads at the end of the head section, after Exposure’s application code.
Best for:
-
Analytics tracking (Google Analytics, Plausible, etc.)
-
Custom fonts
-
Custom CSS styles
-
Most third-party integrations
Footer
Section titled “Footer”Code placed here loads at the end of the body, just before the closing tag.
Best for:
-
Heavier scripts that might affect page load
-
Code that needs the DOM fully loaded
-
Chat widgets and support tools
How to Add Code
Section titled “How to Add Code”-
Click Edit next to the section where you want to add code
-
Enter your code in the editor
-
The editor provides syntax highlighting to help you write error-free code
-
Click Save Custom Code when finished
Your code will take effect on the next page load.
Code Format
Section titled “Code Format”Always wrap your code in the appropriate tags:
Code Type | Wrapper Tags |
JavaScript | Wrap in script tags |
CSS | Wrap in style tags |
External scripts | Use script tag with src attribute |
Common Use Cases
Section titled “Common Use Cases”Analytics Tracking
Section titled “Analytics Tracking”Paste your Google Analytics, Plausible, Fathom, or other analytics tracking code in the Head (Late) section. Most analytics providers give you a code snippet to copy and paste directly.
Custom Fonts
Section titled “Custom Fonts”Add Google Fonts or other web fonts using a link tag for the font stylesheet, then add a style block to apply the font to your site.
Custom CSS Styling
Section titled “Custom CSS Styling”Add a style block with your custom CSS rules. You can hide elements, change colors, adjust spacing, or completely restyle parts of your site.
Chat Widgets
Section titled “Chat Widgets”Tools like Intercom, Drift, or Crisp usually provide a script snippet. Paste it in the Footer section so it loads after your page content.
Plan Availability
Section titled “Plan Availability”Custom Code injection is available on the Business plan. If you’re on a different plan, you’ll see a prompt to upgrade when visiting Developer Options.
-
Test your code on a single page before applying site-wide
-
Use browser developer tools (F12) to debug any issues
-
Keep your code organized with comments
-
External scripts may affect page load speed
-
Save frequently while making changes
Need Help?
Section titled “Need Help?”If you need assistance with custom code or have questions about what’s possible, reach out to us at support@exposure.co. We’re happy to help!
Need help?
Section titled “Need help?”Use the Exposure contact form.
