Changing the behavior of an existing campaign element by customizing its template

Certain details about how a trigger, target, or action works are defined in the campaign element template definition for the trigger, target, or action. To change any details in the existing campaign element template definition, create a customized campaign element template definition with the same name and any changed parameters. Then register your customized campaign element template in the DMELETEMPLATE table. As a result, the marketing services will use your customized template instead of the default template.

Before you begin

To understand the purpose and contents of a campaign element template definition, read Campaign element template definitions.

About this task

Here is an example of a change you could make to a target by customizing the campaign element template definition:
Marketing Managers at your site want to use the Online Behavior target to record customers' searching behavior. To detect the search term a customer has used, the Online Behavior target checks the value of the URL parameter searchTerm on a search results page. Your site does not use the URL parameter searchTerm; instead, it uses s. Therefore, to make this target work for your site, you must register a custom campaign element template definition for the Online Behavior target in the DMELETEMPLATE table. Your custom template will have the same template name as the default, but you must change this line of code within the behavior rule XML fragment to specify the URL parameter s instead of searchTerm:
<Variable name="searchTerm" value="MARKETING_searchTermList" type="NVP"/>


  1. For the trigger, target or action you want to change, determine the name of its campaign element template. See List of shipped campaign element templates and task commands.
  2. HCL Commerce Developer Access the development database.
  3. To extract the existing campaign element template definition from the DMELETEMPLATE table so that you can create a custom template, run a SQL command. Use the following example SQL command, but replace name_of_template with the campaign element template name you want to extract:
    select * from dmeletemplate where name = 'name_of_template';
  4. Make the required changes to the code for the campaign element template.
  5. Write a SQL command to register your custom campaign element template definition in the DMELETEMPLATE table as a new row. For the example described earlier in this topic, the SQL command might look like this (information about the black numbered call-outs follows the sample command):
      insert into dmeletemplate (dmeletemplate_id, storeent_id, dmelementtype_id, name, implxml, behaviorxml, relatedxml) 
    1 values (1205, 0, 
        (select dmelementtype_id from dmeletemplate where dmeletemplate_id = 205),
    2 (select name from dmeletemplate where dmeletemplate_id = 205), 
        (select implxml from dmeletemplate where dmeletemplate_id = 205),
        '<BehaviorRule command="AjaxCatalogSearchView,CatalogSearchResultView" 
                  3  <Variable name="s" value="MARKETING_searchTermList" type="NVP"/> 
                       <Variable name="MARKETING_beforeAfterOnDate" value="MARKETING_date1" type="CURRENTDATE"/>
                       <Variable name="MARKETING_beforeDate" value="MARKETING_date2" type="CURRENTDATE"/>
        (select relatedxml from dmeletemplate where dmeletemplate_id = 205)
    • 1: You have two options for the storeent_id value:
      • If you want the custom campaign element template to override the default template for all stores, then insert 0 for the storeent_id, as shown in this example.
      • If you want the custom campaign element template to override the default template for only a specific store, then insert the storeent_id value for the specific store instead of 0. This is the value located in the STOREENT_ID column of the STOREENT database table.
    • 2: Do not rename the custom campaign element template; keep the same name used for the default template.
    • 3: This line represents the changed URL parameter. The value for name is changed to s instead of searchTerm.