bea.com | products | dev2dev | support | askBEA |
![]() |
![]() |
|
![]() |
e-docs > WebLogic Platform > WebLogic Portal > Development Guide > Setting Up Campaign Services |
Development Guide
|
Setting Up Campaign Services
A campaign coordinates several WebLogic Portal services to create and track marketing goals on an e-commerce Web site. For example, your marketing organization can use campaigns to sell 100 ACME saws during the month of June. To reach this goal, Marketing can target advertising, e-mail, and discounted product pricing to customers who match a set of criteria, such as customers who have previously purchased ACME hardware from your site.
Your responsibility in setting up a campaign service is to develop the infrastructure to support the campaigns and modify that infrastructure as individual campaigns require. This activity can include building placeholders for campaigns, specifying display and clickthrough behavior, loading ads into a content management system, creating personalized e-mails for campaigns, and sending bulk mail to prospective and existing customers.
This section contains information on the following subjects:
Note: Campaigns cannot be used with anonymous users.
What are Campaign Services?
Campaigns coordinate the following services:
Scenarios can engage any of the following services:
Discounts These offer reduced prices for specific products or product categories. You can creates discount in the E-Business Control Center.
Building Placeholders for Campaigns
The ad placeholder is a container that generates the HTML that the browser requires to display the ad content and places it in the JSP at the location of the placeholder tag. An ad is a document in your content management system that an ad placeholder displays. Ads can be an integral part to a campaign. For example, campaigns can specify as a goal to record a specific number of ad clickthroughs.
Using Attributes to Specify Display and Clickthrough Behavior
You need to define the document attributes in your content management system that ad placeholders use to support the following features:
For information about associating attributes with documents, refer to the documentation for your content management system. If you use the reference content management system supplied by BEA, refer to Loading Ads into the Reference Content Management System. Valid attributes are listed in Table 13-1, Table 13-2, and Table 13-3.
Loading Ads Into Your Content Management System
The queries you can define for ad placeholders search through the attributes that you attach to the documents in your content management system. WebLogic Portal places no restrictions on the set of attributes that you use to describe your ads. For example, you can create attributes that describe the name of the product that the document advertises, the name of the ad sponsor, and a product category that matches the categories in your e-commerce product catalog.
The method of loading ads into a content management system is dictated by the CMS.
Loading Ads into the Reference Content Management System
WebLogic Portal provides a content management system for sites with limited content-management needs. If you use the reference content management system, you must load ads and ad attributes at the same time. You cannot add attributes to documents that have already been loaded.
When you install WebLogic Portal, the reference content management system (which uses the sample PointBase database) already contains a set of sample ads.
To load ads and ad attributes into the reference content management system, you must do the following:
Step 1. Set Up Attributes in HTML Documents
For ads that contain only HTML, you must place document attributes in <META> tags within a document's <HEAD> element. Use the following syntax in the <META> tag:
<META name="attribute-name" content="attribute-value">
Use a separate <META> tag for each document attribute. For example:
<META name="attribute1-name" content="attribute1-value">
<META name="attribute2-name" content="attribute2-value">
<META name="attribute3-name" content="attribute3-value">
Listing 13-1 shows an HTML file that contains a simple ad with several attributes.
Listing 13-1 Attributes for an HTML Ad
<HTML>
<HEAD>
<META name="adWeight" content="3">
<META name="productCategory" content="hardware">
<META name="productSubCategory" content="electic drill">
<META name="productName" content="Super Drill">
<META name="Manufacturer" content="ACME">
</HEAD>
<BODY>
<P>Buy our Super Drill. It'll get the job done!</P>
</BODY>
</HTML>
Table 13-1 describes the adWeight attribute, which you can associate with XHTML, image, and Shockwave documents.
Step 2. Set Up Attribute Files for Image and Shockwave Documents For ads that are images or Shockwave movies, you must place attributes in a separate file. Each image or Shockwave file must be accompanied by a separate file that is named with the following convention: filename.extension.md.properties Both files must be located in the same directory. For example, for an image file named superDrill.jpg, you must place attributes in a file named superDrill.jpg.md.properties. Within the filename.extension.md.properties file, use the following syntax to express attributes and values: attribute-name=attribute-value Listing 13-2 shows an example file that contains attributes for an image ad. Listing 13-2 Syntax for the Attributes File Other Image File Attributes Table 13-2 describes other attributes, in addition to adWeight, that you can associate with image files.
adWeight=5
adTargetUrl=AcmeAds/saws.jpg
adAltText=Buy ACME and save!productCategory=hardware
productSubCategory=electic drill
productName=Super Drill
Manufacturer=ACME
Other Shockwave Attributes Table 13-3 describes other attributes, in addition to adWeight, that you can associate with Shockwave files. Ad placeholders and the <ad:adTarget> tag format these values as attributes of the <OBJECT> tag, which Internet Explorer on Windows uses to display the file, and the <EMBED> tag, which browsers that support the Netscape-compatible plug-in use to display the file. For more information about these attributes, refer to your Shockwave developer documentation.
Step 3. Move Files Into the dmsBase/Ads Directory Tree To make the ads available to the campaign, place all HTML, image, and Shockwave files, and all attributes files into the Ads directory, which is located at the following path: (where <BEA_HOME> is the directory in which you installed BEA WebLogic Platform and where <YOUR-APPLICATIONDOMAIN> is the directory of the particular domain). You can place documents in subdirectories of the Ads directory, although the reference content management system does not use the subdirectories to organize documents. If you use subdirectories to manage your source files, you must place the attributes files in the same directory as the files that they describe. For example, superDrill.jpg and superDrill.jpg.md.properties must be in the same directory. Step 4. Run the loadads Script The loadads script (loadad.bat for Windows user; loadad.sh for Unix users) runs the BulkLoader to load documents from the dmsBase/Ads directory to the content management system. It also attaches attributes to the documents. To run loadads, do one of the following:
<BEA_HOME>/user_projects/<YOUR-APPLICATIONDOMAIN>/dmsBase/Ads
OR
For more information on running the BulkLoader, please see Adding Content by Using the Bulk Loader.
Creating Personalized E-mails for Campaigns
The E-mail service uses a JSP to generate e-mail and provides a utility for sending the e-mail in batches. Because the Mail service uses a JSP to generate e-mail, you can use JSP tags to personalize the e-mail. This section shows you how to create personalized e-mails for campaigns by following these steps:
Step 1. Configure the E-mail Properties
Before a campaign can send e-mail, you must configure properties that the Campaign Service uses to send and receive mail. In a clustered environment, WebLogic Server propagates these properties to each node in the cluster.
To configure mail-related properties, do the following:
Step 2. Find Names of User Properties
Step 3. Create E-mail JSPs
The Mail Service requires that you place the content and formatting of your e-mails in a JSP file. In this JSP, you can use any of the JSP tags and APIs that are available to other JSPs in WebLogic Portal.
This step describes the following:
E-mail Parameters
When a scenario action requests an e-mail JSP, it passes a userid parameter, which specifies the login name of the customer who triggered the scenario action. By using the request.getParameter() method, you can retrieve the user ID and pass it to JSP tags in the e-mail JSP.
In addition, the scenario passes the following parameters (you can also pass these parameters to JSP tags in the e-mail JSP):
Disabling Session Generation
The Java class that the Campaign Service uses to generate email from a JSP, InternalRequestDispatcher, also generates an HTTPSession object. Usually, generating this HTTPSession from an email JSP is extraneous because your application already generates an HTTPSession object when a customer accesses your site.
To disable the generation of an extraneous HTTPSession, add the following directive to the beginning of the JSPs that you use to generate email for campaigns:
<%@ page session="false" %>
Adding this directive is necessary only if your application generates HTTPSession objects when customers access your site (or log in) and only for email that is generated via the InternalRequestDispatcher.
Sample E-mail JSP
Listing 13-3 shows the e-mail JSP that is part of the sample Web application. The file is located at <BEA_HOME>/weblogic700/samples/portal/ wlcsDomain/beaApps/wlcsApp/wlcs/campaigns/emails/
Listing 13-3 Sample E-mail JSP
Sample1.jsp
<%@ page session="false" %>
<%@ page contentType="text/plain" %>
(This sample e-mail was automatically sent out as part of a sample campaign that you triggered while registering as a new user on the BEA Commerce Templates.)
-------------------------------
Hello <%= request.getParameter("userId") %>,
Thank you for taking the time to become a registered member of our site. We hope you took advantage of your $10 discount on a purchase of $50 or more after you registered!
In addition, your registration entitles you to premium services including:
**Special "Members Only" discounts
**Advance notice of new product releases
**A personalized customer experience customized to
your specific interests
Thanks again for becoming a registered member.
Best Regards
Saving E-Mail JSPs
You must save e-mail JSPs in a specific directory within a Web application so that E-Business Control Center user can browse and select the e-mail for a campaign.
By default, the directory is myApp/myWebApp/campaigns/emails.
(Where myWebApp is the name of a Web application containing the campaign)
For example, the Web application wlcs provides a sample e-mail in the following directory:
<BEA_HOME>/weblogic700/samples/portal/wlcsDomain/beaApps/wlcsApp/
wlcs/campaigns/emails/Sample1.jsp
To choose this e-mail as part of a scenario action, do the following:
To change the default location in which you save e-mail JSPs, do the following:
Sending Bulk Mail
You must periodically use a command to send the batched e-mail that the JSPs store in the WebLogic Portal data repository. You can also use cron or any other scheduler that your operating system supports to issue the send-mail command.
This section includes information on the following subsections:
Sending Mail from a Remote Host or in a Clustered Environment
The send-mail wrapper script specifies the name and listen port of the WebLogic Portal host that processes the send-mail request. By default, the wrapper script specifies localhost:7501 for the hostname and listen port. However, localhost:7501 is valid only when you run the script while logged in to a WebLogic Portal host in a single-node environment (and only if you did not modify the default listen port).
Before you use the send-mail script from any other configuration, you must modify the script by doing one of the following tasks:
Modify the Send-Mail Script to Work from a Remote Host
If you want to run the send-mail script from a remote host (that is, a computer that is not a WebLogic Portal host), do the following:
Modify the Send-Mail Script to Work in a Clustered Environment
If you work in a clustered environment, you must modify the send-mail wrapper script to specify the name of a host in the cluster. The default localhost value is not valid for the Mail Service in a clustered environment.
To use the send-mail script in a clustered environment, do the following on each host from which you want to run the script:
Sending Bulk E-mail
To send bulk e-mail, do the following from a shell that is logged in to a WebLogic Portal host:
Scheduling Bulk E-mail Delivery
You can use a scheduling utility to send the e-mail batches in the data repository. Because you must specify the name of a batch when you use the mailmanager command to send mail, you must schedule sending mail for each campaign scenario separately. The name of a batch corresponds to the scenario's container ID. For information about the container ID, refer to E-mail Parameters.
For information in using a scheduling utility, refer to the documentation for your operating system.
Deleting E-mail Batches
You can delete e-mail batches as you send them (as described in Sending Bulk E-mail). You can also do the following to delete e-mail batches:
![]() |
![]() |
![]() |
![]() |
||
![]() |
![]() |
![]() |
![]() |
![]() |
|
![]() |