Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device.
Atlassian cookies and tracking notice, (opens new window)
Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
🔍 Discover Our Product Documentation

Barracuda Load Balancer ADC
Results will update as you type.
  • How to Update Your Notification Email Addresses
  • What's New in the Barracuda Load Balancer ADC
  • Deployment
  • Getting Started
  • Barracuda Load Balancer ADC Hardware Features
  • Application Deployment Guides
  • Barracuda Load Balancer ADC - REST API
  • Services
  • Access Control
  • Technical White Papers
  • Traffic Management
    • Content Rules for HTTP and HTTPS Services
    • Extended Match and Condition Expressions
    • Understanding HTTP Rewrite Rules
    • Content Rewriting
    • Example - Using Response Body Rewrite to Enable Web Sites for Google Analytics
    • Understanding HTTP Caching
    • Understanding HTTP Compression
  • Logging
  • Global Server Load Balancing
  • Application Security
  • Networking
  • Certificate Management
  • Monitoring
  • High Availability
  • System Administration and Maintenance
  • End of Support and End of Life Information
  • Critical Vulnerabilities

    You‘re viewing this with anonymous access, so some content might be blocked.
    /
    Example - Using Response Body Rewrite to Enable Web Sites for Google Analytics
    Published Jan 09

    Example - Using Response Body Rewrite to Enable Web Sites for Google Analytics

    Jan 09, 2026
    Subscribe

    Response Body Rewrite rules apply to only HTTP and HTTPS services.

    This article assumes you have a Google® Analytics™ account to obtain the code for use in the response body.

    The Response Body Rewrite option provides a single point for managing response rewrites to offload Google indexing to the Barracuda Load Balancer ADC. Create rules to search and replace any string in the body of outbound responses to remove server banners or other header or body information that you do not want clients to see, to eliminate extra code in web site pages. Only responses where the content-type begins with text/ (for example: text/html, text/plain, text/javascript, text/css, text/xml) are searched; Flash and applet content are unsupported.

    The search and replace strings must be text; regular expressions cannot be used.

    Google Analytics Example

    This procedure provides instructions for creating a Response Body Rewrite rule to offload Google indexing by inserting Google Analytics code into responses. This rule example searches for the </html> string that is on every page and then adds the Google analytics code before the string.

    1. Log into the Barracuda Load Balancer ADC as the administrator, and go to the TRAFFIC > Web Translations page.

    2. In the Response Body Rewrite section, click Add Rule. 

    3. In the Add Response Body Rewrite window, configure these settings:

      • Rule Name: Google

      • Host Match :  *  

      • URL Match :  /*  

      • Search String :  </html>

      • Replace String :
        <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl. " : *http://www. ); document.write(unescape{"%3Cscript src="+gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));</script> <script type="text/javascript"> try {var pageTracker = gatgetTracker{"UA-6605828-2");
        pageTracker._trackPageview(); } catch (err) {}</script> </body></html> 

    4. Click Save. The rule appears in the Response Body Rewrite table.


    We value your feedback.
    If you have questions, suggestions, or feedback on our documentation, contact the Campus Product Documentation team.
    For general product inquiries or technical support, please contact the global Barracuda Support team.

    {"serverDuration": 14, "requestCorrelationId": "0b1ab1d78ba74eb3848632a95c66fd94"}