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
Results will update as you type.
  • What's New in the Barracuda Load Balancer
  • Deployment Options
  • Getting Started
  • Services
  • Traffic Management
  • Global Server Load Balancing
  • Networking
  • Certificate Management
  • Monitoring
  • Maintenance
  • Tools and Add-Ins
    • How to Use the Response Rewrite Function to Enable Web Sites for Google Analytics
  • APIs
  • Barracuda Load Balancer Hardware
  • Downloads

    You‘re viewing this with anonymous access, so some content might be blocked.
    /
    How to Use the Response Rewrite Function to Enable Web Sites for Google Analytics
    Published Jan 22

    How to Use the Response Rewrite Function to Enable Web Sites for Google Analytics

    Jan 22, 2026
    Subscribe

    This article refers to firmware 3.1 and higher, running on a Barracuda Load Balancer 340 or higher.

    Response Body Rewrite rules apply to Layer 7 - HTTP Services only.

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

    Response Body Rewrite Rules

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

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

    Google Analytics Example

    This example describes how to offload Google indexing by inserting Google Analytics code into the responses by looking for a unique text string, for example, </html> or Copyright, guaranteed to appear in a page only once, for search and replace to avoid duplication.

    In this example, for the response body rewrite, the Google Analytics code is inserted into the responses by the 'string' guaranteed to be present in every page, which is then replaced with the 'string' + 'Google Analytics code'.

    To create the rule, complete the following steps:

    1. Log into the Barracuda Load Balancer as the administrator, and go to the WEBSITES > URL Rewrites page.

    2. Go to the Response Body Rewrite section. In the Rule Name field enter a name for the rule, for example: Google

    3. In the Rule Order field, enter the order of execution if there is more than one rule. Range: 1 to 128, where 1 is executed first.

    4. In the Host Match field, Enter * which will be used to match the hostname field in the request header.

    5. In the URL Match field, enter /* which will be used to match the URL field in the request header. This value means that the ACL applies for all URLs in that domain.

    6. In the Search String field, enter the unique text string to be searched, for example: </html>

    7. In the Replace String field, enter the Google Analytics code followed by the search string, for example:

    8. Click Add.

     

    Related Articles

    Understanding URL Rewrite Rules


    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": 12, "requestCorrelationId": "4f38f57ccecc4b1ca19589545f681882"}