Reference > Analytics for IBM WebSphere Commerce > Analytics tag library for IBM WebSphere Commerce


Campaign URL tag

The campaign URL tag collects information about the various marketing campaign activities and sends the information to an external analytics system.

The data generated by the tag includes:

WebSphere Commerce provides an abstract base tag implementation class for the Campaign URL tag:

CampaignBaseTag

This base tag collects information about a marketing campaign activity. Analytics vendors who want to provide a campaign URL tag in their Web analytics JSP tag library for WebSphere Commerce can extend this base tag class to get the campaign data and implement their own logic to generate the vendor-specific campaign tagging APIs.


Parameters

The campaign URL tag takes the following parameters:

url

A required parameter that is a string representation of a URL, or a variable created using the <c:url> tag to be modified.

id

A required parameter that identifies the variable name in which to place the modified URL.

name

This variable is used to override the name of the content (collateral, catalog entry, category, or associated catalog entry). If supplied, it is used instead of the default value obtained by a lookup.

databean

A optional parameter that is a populated instance of an e-Marketing Spot data bean.

initiative

A required parameter that identifies the ID of the particular initiative assigned to the e-Marketing Spot to which the URL corresponds.

scope

An optional parameter that specifies the scope in which the variable of the modified URL applies. Valid values are:

1

(Default) The variable applies to this page. The variable might be different the next time the page is loaded.

2

The variable applies to this request. The variable might be different the next time the e-Marketing Spot is requested, even for the same page.

3

The variable applies to the current session. The variable might be different the next time the customer browses the site.

4

The variable applies to the current application, and will not change.

espotData

An optional parameter that is a populated instance of the MarketingSpotDataType class. Use this parameter if the store JSP pages are implemented using WebSphere Commerce services.


Campaign URL tag for Coremetrics

WebSphere Commerce provides a default implementation of the campaign URL tag for Coremetrics. This tag must be included in all e-Marketing Spot JSP files. It appends campaign-related information to a URL to track campaign click-throughs and stores the result in the ID object.

To use this tag, include the tag library in the JSP page. The tag library must be referenced prior to the main page content. Use the following tag so that the JSP page refers to the tag library:

<%@ taglib uri="http://commerce.ibm.com/coremetrics" prefix="cm" %> 


Examples

The campaign URL can be included in multiple locations in the e-Marketing Spot JSP file, depending on how that JSP file is coded.

To add the campaign URL tag, include code similar to the following snippet:

<cm:campurl databean="${eMarketingSpot}" id="ClickInfoURL"
      url="${ClickInfoURL}" 
      initiative="${catEntry.initiativeId}"
      name="${catEntry.description.name}" />

or

<cm:campurl espotData="${marketingSpotData}" id="ClickInfoURL"
      url="${ClickInfoURL}" 
      initiative="${catEntry.initiativeId}"
      name="${catEntry.description.name}" />


XML definition

  
<tag>        
<name>campurl</name>        
<tag-class>com.ibm.commerce.bi.taglib.coremetrics.CampaignURLTag</tag-class>        
<body-content>empty</body-content>        
<description>Appends campaign-related information to an URL to track 
            campaign click-thrus and stores the result in the "id" object.</description>        
<attribute>            
<name>url</name>            
<required>true</required>            
<rtexprvalue>true</rtexprvalue>            
<description>String of an URL, or a variable created using the 
                &lt;c:url&gt; tag that will be modified.</description>        
</attribute>        
<attribute>            
<name>id</name>            
<required>true</required>            
<rtexprvalue>false</rtexprvalue>            
<description>The variable name that the modified URL will be 
                placed in.</description>        
</attribute>        
<attribute>            
<name>databean</name>            
<required>false</required>            
<rtexprvalue>true</rtexprvalue>            
<description>Populated instance of 
                com.ibm.commerce.marketing.beans.EMarketingSpot.</description>        
</attribute>        
<attribute>            
<name>espotData</name>            
<required>false</required>            
<rtexprvalue>true</rtexprvalue>            
<description>Populated instance of 
                com.ibm.commerce.marketing.beans.EMarketingSpot.</description>        
</attribute>        
       
<attribute>            
<name>initiative</name>            
<required>true</required>            
<rtexprvalue>true</rtexprvalue>            
<description>The ID of the particular initiative assigned to the 
                EMarketingSpot that this URL will be for.</description>        
</attribute>        
<attribute>            
<name>name</name>            
<required>false</required>            
<rtexprvalue>true</rtexprvalue>            
<description>This variable is used to override the name of the 
                content (collateral, catalog entry, category or associated 
                catalog entry). If supplied, it will be used instead of looking 
                it up.</description>        
</attribute>        
<attribute>            
<name>scope</name>            
<required>false</required>            
<rtexprvalue>true</rtexprvalue>            
<description>The scope in which the variable of the modified URL 
                will be placed. Valid values are 1 for "page", 2 for "request", 
                3 for "session", or 4 for "application". If missing, the default 
                "page" will be used.</description>        
</attribute>    
</tag>   


Related tasks

Tag the store pages for Coremetrics

Related reference

Page view tag

Order tag

Shop cart tag

Product tag

Registration tag

Content URL tag

Generic tag


+

Search Tips   |   Advanced Search