> ## Documentation Index
> Fetch the complete documentation index at: https://beta-docs.replo.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Adding Scripts

> Add tracking pixels and custom scripts, site-wide or per page.

Scripts are snippets of code that extend your store's functionality and tracking capabilities. They let you connect third-party tools, run custom interactions, and measure performance across your funnel.

## Why ecommerce stores need scripts

Scripts power essential parts of your marketing stack. Without them, you can't track conversions, optimize campaigns, or create personalized experiences.

**Tracking and measurement**: Scripts from analytics platforms and ad networks (Meta Pixel, Google Analytics, TikTok Pixel) capture visitor behavior, clicks, and purchases. This data feeds into your CAC, CVR, and ROAS calculations so you can see what's working.

**Interactive experiences**: Page-level scripts enable quizzes, personalization apps, exit-intent pop-ups, and cart abandonment flows. These tools improve conversion rates by creating more engaging, tailored experiences for visitors.

**Integration with marketing tools**: Scripts connect your store to email platforms (Klaviyo), SMS tools (Postscript, Attentive), and other services that power your customer acquisition and retention workflows.

## When to use site-wide vs. page-level scripts

<Tabs>
  <Tab title="Site-wide scripts">
    Use site-wide scripts for tools that need to track activity across your entire store.

    **Best for:**

    * Analytics and tracking pixels (Meta Pixel, Google Analytics, TikTok Pixel)
    * Performance measurement (CTR, CVR, conversion tracking)
    * Tools that should fire on every page visit
    * Universal integrations (payment processors, shipping calculators)
  </Tab>

  <Tab title="Page-level scripts">
    Use page-level scripts for interactions specific to individual pages.

    **Best for:**

    * Quizzes and interactive surveys
    * Personalization apps
    * Exit-intent pop-ups
    * Page-specific tracking events
    * Product finders or recommendation tools
  </Tab>
</Tabs>

## Where to add scripts in Replo

### Site-wide scripts

Add site-wide scripts in **Site settings**, under the **Scripts & Pixels** tab. These scripts load on every page of your site, making them ideal for marketing performance tracking.

<Steps>
  <Step title="Open Site settings">
    In the [Website Builder](/apps/website-builder), open the **⋯ more-options menu** in the top bar and choose **Site settings**.
  </Step>

  <Step title="Open the Scripts & Pixels tab">
    Common pixels (Google Analytics, Meta, TikTok, Pinterest, Reddit, Snapchat) have built-in entries; select one and add your ID. There's also a cookie consent control for GDPR/CCPA.

    <Frame>
      <img src="https://mintcdn.com/replo-agent-docs/mSW6Z6kb8wLdtF-_/images/cropped/site-settings-pixels.png?fit=max&auto=format&n=mSW6Z6kb8wLdtF-_&q=85&s=41b3e92f289dd0f73fefafa392c4fbde" alt="The Scripts & Pixels tab in Site settings, with a cookie consent control and built-in entries for common pixels" width="2000" height="1692" data-path="images/cropped/site-settings-pixels.png" />
    </Frame>
  </Step>

  <Step title="Add a custom script">
    For anything not listed, paste the script code, or ask Replo in chat to add it for you.
  </Step>
</Steps>

<Tip>
  Site-wide scripts are best for marketing performance tracking tools that need to measure activity across your entire funnel, pixels, analytics platforms, and attribution tools.
</Tip>

### Page-level scripts

For page-specific interactions like quizzes, personalization apps, pop-ups, or custom tracking events, add scripts directly to individual pages through Replo.

<Steps>
  <Step title="Open your page">
    In the Website Builder, open the page where you want to add the script.
  </Step>

  <Step title="Provide your script snippet">
    Prompt Replo with the script you need to add and paste in the correct code snippet.

    For example:

    ```text theme={null}
    Add this quiz script to the page: insert [your script code]
    ```
  </Step>

  <Step title="Verify the script is added">
    The script will be integrated into your page. Republish your page to make it live.
  </Step>
</Steps>

<Tip>
  Page-level scripts are perfect for tools that should only run on specific pages. This includes quizzes, product finders, exit-intent pop-ups, and personalization apps that create unique shopping experiences per page.
</Tip>

***

## FAQ

<AccordionGroup>
  <Accordion title="Can I add the same script both site-wide and on a specific page?">
    Typically, no. Most scripts should only be added once. Adding a script in both places usually results in duplicate tracking, which skews your data. In addition,  adding unnecessary scripts globally slows down your site. Choose site-wide if you need it everywhere, or page-level if it's page-specific.
  </Accordion>

  <Accordion title="Do I need to republish after adding scripts?">
    Yes. After adding scripts, whether site-wide or page-level, you need to republish your pages for the changes to go live. Site-wide scripts apply to all pages on your next publish; page-level scripts only apply to the specific page you updated.
  </Accordion>

  <Accordion title="How do I verify my scripts are working?">
    Most tracking scripts have browser extensions or test tools (Meta Pixel Helper, Google Tag Assistant) that verify scripts are firing correctly. Check your analytics dashboard or ad platform to confirm events are being tracked. For page-level scripts, test the functionality directly on your published page.
  </Accordion>
</AccordionGroup>
