It seems like your browser didn't download the required fonts. Please revise your security settings and try again.
Barracuda Load Balancer

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

  • Last updated on

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:
    response body rewrite.jpg
  8. Click Add.

 

Related Articles

Understanding URL Rewrite Rules