Add Optimize Tags to Existing Web Pages

Enable your existing web pages for testing by adding the necessary JavaScript tags.

  1. Place the Client API (CAPI) script before the closing </head> of the web page. This script prepares the page for testing before any content is rendered in the Web browser. Substitute the src value with the location where you uploaded the Webtrends CAPI file (wt_capi.js).

    <script type="text/javascript" src="location_of_wt_capi.js"></script>

    Note: If necessary, you can place the script tag in the body of the web page, but it must appear before the WTOptimize.setup() call.
  2. Place the Optimize Setup script just after the opening <body> of the web page. This script initiates the page to search the HTML markup for elements that have been identified as test factors and rotate those elements as it displays the page to different visitors.

    <script type="text/javascript">WTOptimize.setup();</script>

  3. (For Multivariate Tests) Identify the test factors on the web page. Using the HTML attribute ID, add a unique identifier to the elements that you want to test, such as headings, images, or buttons.

    <h1 id="headline">Featured News Story</h1>

  4. Save the page.

Example HTML Page with Optimize Tags

                
<html>
        
<head>
<title>Landing Page</title> 
<script type="text/javascript" src="wt_capi.js"></script> 
</head>
         
<body> 
<script type="text/javascript">WTOptimize.setup();</script> 
<h1 id="headline">Check out this new widget!</h1>
<div id="image">
<img src="images/green_widget.jpg" alt="" />
</div>
<p>Are you looking for the world's best new widgets?</p>
<a id="call_to_action" href="signup.html" 
</body>
</html>