Autonnel v0.1.0

Global scripts

Inject HEAD / BODY_START / BODY_END scripts site-wide. Per-deployment.


Global scripts are snippets of HTML or JavaScript that Autonnel injects into every storefront page served by your deployment. Each deployment’s scripts are stored independently. You manage them from Settings → Scripts.

Injection positions

Each script is assigned one of three positions:

PositionWhere it is injected
HEADInside the <head> element, after meta tags
BODY_STARTImmediately after the opening <body> tag
BODY_ENDImmediately before the closing </body> tag

Scripts within the same position are injected in the order shown. You can reorder them by dragging rows in the settings table.

Adding a script

  1. Go to Settings → Scripts.
  2. Click Add script.
  3. Enter a name (used only in the admin list — not rendered to the page).
  4. Select a position from the dropdown.
  5. Paste your script content. This should be a complete <script> tag or a <noscript> fallback block, not bare JavaScript.
  6. Click Save.

The script is enabled by default. You can disable a script without deleting it by toggling the Enabled switch.

Common use cases

Site-wide analytics

Paste your Google Analytics, Plausible, or Mixpanel loader into the HEAD position:

<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'G-XXXXXXXXXX');
</script>

Advertising pixels

Paste a Meta Pixel base code or TikTok Pixel base code into HEAD or BODY_START. The pixel fires on every page load. Per-funnel event-specific pixels (Purchase, AddToCart) are configured separately in Funnel → Ads, not here.

Custom interaction JavaScript

If you need a script to run after the DOM is ready, use BODY_END:

<script>
  document.addEventListener('DOMContentLoaded', function () {
    // your code
  });
</script>

Script ordering relative to funnel scripts

Funnel scripts (configured per funnel in Funnel → Scripts) are injected after site-level scripts within the same position. The full injection order for a given position is:

  1. Site global scripts (this page), ordered by their order field
  2. Funnel scripts for the current funnel, ordered by their order field

This means a site-level Meta Pixel base code in HEAD always loads before a funnel-specific Meta Pixel event script in HEAD.

Caveats

  • Scripts in the HEAD position are render-blocking by default. Use the async or defer attribute on <script> tags unless the script explicitly requires synchronous execution.
  • A script that throws a JavaScript error in BODY_START can block subsequent scripts in that position. Test scripts in isolation before enabling them site-wide.
  • Global scripts run on every storefront page — landing pages, checkout, upsell, thank-you, and error pages. If a script should only run on specific page types, use a funnel script instead, or add a conditional check inside the script content.
  • Conflicts between site-level and funnel-level pixels can cause double-fires. If you have a Meta Pixel in both global scripts and a funnel script, verify that one fires the base code and the other fires only the event, not both.