Tips for testing triggers and actions in dialog activities

When you are testing a dialog activity, you can trigger the activity in a test environment and verify whether the activity produces the right action for the target customer.

The following table provides some tips for simulating dialog activity triggers in a test environment and speeding up the waiting period for certain triggers.

Trigger Testing tips
Customer Is In Segment
  1. Create a test customer who belongs to the customer segment that the trigger checks. How you create this customer depends on the customer segment.

    For example, if the customer segment is "Female Customers," then register as a customer who specifies their gender as female on the registration page.

    Alternatively, to quickly add a registered customer to any customer segment, open the customer segment in the Marketing tool and use the Included customers field to add the customer.

    If the customer segment is built dynamically using the Add To Or Remove From Customer Segment action in a different marketing activity, then complete the activity flow in that marketing activity as a test customer who is then added dynamically to the segment.

  2. Run an SQL query to force the daily processing of the trigger to occur again.

    Once a day at 2:00 AM. (by default), the marketing services send the Customer Is In Segment trigger to be processed by the SendMarketingTriggers scheduled job. On the day you are testing, if the send time is passed, you can resend the trigger for processing. To do so, use the following SQL query to remove the entry from the DMACTATTR table that records that the trigger is processed. As a result, the trigger will be processed the next time the SendMarketingTriggers scheduled job runs.

    DELETE FROM DMACTATTR WHERE DMACTIVITY_ID = 
    0 OR DMACTIVITY_ID = (SELECT DMACTIVITY_ID 
    FROM DMACTIVITY WHERE 
    NAME = 'activity_name');

    Where activity_name is the name of the activity you are testing.

  3. Using the Administration Console, either run the SendMarketingTriggers job manually or wait for the next time the job runs according to its schedule interval setting.
Customer Abandons Shopping Cart
  1. Register with the store in the test environment as a test customer; then place items in the shopping cart.
  2. For the ORDERS table, run an SQL query to simulate an abandoned cart for the test customer.

    For example, if the criteria for the trigger is "Check for customers with carts abandoned for 3 days," then manually change the ORDERS.LASTUPDATE data so that the last update date for the test customer's order was three days ago:

    1. To get the order ID and order time for the test customer's order, run the following SQL query:
      SELECT ORDERS_ID, LASTUPDATE FROM ORDERS 
      WHERE MEMBER_ID = (SELECT USERS_ID FROM 
      USERREG WHERE LOGONID='logon_ID')
       ORDER BY ORDERS_ID DESC

      Where logon_ID is the logon ID of the test customer that is created during registration.

    2. To set the last update date for this order to be, for example, 3 days in the past, run the following SQL query:
      UPDATE ORDERS SET LASTUPDATE = 
      'updated_order_time' WHERE 
      ORDERS_ID = order_ID
      where:
      updated_order_time
      is the timestamp to represent when the cart was abandoned for testing purposes. Use the same timestamp format that is used for the order time you retrieved with the first SQL query.
      order_ID
      is the ID of the order for the test customer that you retrieved with the first SQL query
  3. Run an SQL query to force the daily processing of the trigger to occur again.

    Once a day at 2:00 AM (by default), the marketing services send the Customer Abandons Shopping Cart trigger to be processed by the SendMarketingTriggers scheduled job. On the day you are testing, if the send time is passed, you can resend the trigger for processing. To do so, use the following SQL query to remove the entry from the DMACTATTR table that records that the trigger is processed. As a result, the trigger will be processed the next time the SendMarketingTriggers scheduled job runs.

    DELETE FROM DMACTATTR WHERE DMACTIVITY_ID = 
    0 OR DMACTIVITY_ID = (SELECT DMACTIVITY_ID 
    FROM DMACTIVITY WHERE 
    NAME = 'activity_name');

    Where activity_name is the name of the activity you are testing.

  4. Using the Administration Console, either run the SendMarketingTriggers job manually or wait for the next time the job runs according to its schedule interval setting.
Customer Celebrates Birthday
  1. Register with the store in the test environment as a test customer whose supplied birth date meets the trigger criteria.

    For example, if the trigger criteria is "Check for customers whose birthday is in 3 days," then register as a customer whose birthday is three days after the day you are running the test. This way, the activity is triggered for the customer on the day you are testing.

  2. Run an SQL query to force the daily processing of the trigger to occur again.

    Once a day at 2:00 AM (by default), the marketing services send the Customer Celebrates Birthday trigger to be processed by the SendMarketingTriggers scheduled job. On the day you are testing, if the send time is passed, you can resend the trigger for processing. To do so, use the following SQL query to remove the entry from the DMACTATTR table that records that the trigger is processed. As a result, the trigger will be processed the next time the SendMarketingTriggers scheduled job runs.

    DELETE FROM DMACTATTR WHERE DMACTIVITY_ID = 
    0 OR DMACTIVITY_ID = (SELECT DMACTIVITY_ID 
    FROM DMACTIVITY WHERE 
    NAME = 'activity_name');

    Where activity_name is the name of the activity you are testing.

  3. Using the Administration Console, either run the SendMarketingTriggers job manually or wait for the next time the job runs according to its schedule interval setting.
Wait Running the Wait trigger in test mode is covered in Testing dialog activities.
Customer Registers
  1. Register with the store in the test environment as a test customer.
  2. Using the Administration Console, either run the SendMarketingTriggers job manually or wait for the next time the job runs according to its schedule interval setting.
Customer Places Order
  1. Place an order with the store in the test environment.
  2. Using the Administration Console, either run the SendMarketingTriggers job manually or wait for the next time the job runs according to its schedule interval setting.
Customer Participates in Social Commerce
  1. Register with the store in the test environment as a test customer.
  2. Do the social commerce activities to meet the trigger criteria.
    For example, if the trigger criteria is “Customers who have participated in social commerce at least three times," then do any of the following things on your site three times (in total):
    • Post a product review or comment, or rate a product
    • Post a blog entry or comment, or rate a blog entry
    • Upload a photo

    This trigger is processed immediately. You should see the dialog activity action results right away.

Customer Searches
  1. Register with the store in the test environment as a test customer.
  2. Search the store according to the criteria in the trigger.

    This trigger is processed immediately. You should see the dialog activity action results right away.

Customer Checks Out With Promotion
  1. Register with the store in the test environment as a test customer.
  2. Place an order that qualifies for the promotion that is specified in the trigger. You might need to place multiple orders that qualify for the promotion if the Times field in the trigger is set to a number greater than one.
  3. Either wait 5 minutes or manually run the RaiseECEvent scheduled job. To manually run the job, open the RaiseECEvent scheduled job in the Administration Console, and then click OK, which forces the job to run immediately. This job must run so that the marketing services are informed of the test orders you placed. By default, this job runs every 5 minutes.

The following table provides some tips for testing dialog activity actions.

Action Tips for testing
Send Message (email message)
  • Make sure that the test customer that you register opts in to receive marketing email messages during registration.
  • Make sure e-mail activity accounts are configured.
  • If you want the server to send the email right away during testing, open the dialog activity in the Marketing tool. Then, in the properties for the Send Message action, make sure the Send immediately check box is selected.

    After testing, remember to clear the Send immediately check box if you do not want this setting in production due to its performance impacts.

Send Message (Text message (SMS))
  • Make sure that the test customer that you register opts in to receive marketing SMS messages during registration. The mobile phone number must also be able to receive text messages.
  • Make sure that the test environment is configured to send marketing text (SMS) messages. See SMS transport integration and Enabling and configuring the SMS transport.
  • By default, the SendTransactedMsg job sends SMS messages every 5 minutes. If you do not want to wait 5 minutes, you can reduce the schedule interval using the Administration Console.
Issue Coupon Ensure that your store supports coupon wallets so that your test customer receives the coupon in the coupon wallet.
Add To Or Remove From Customer Segment To check whether a registered customer is successfully added to the customer segment after you test the activity, you can run the following SQL query:
SELECT * FROM DMMBRGRPPZN WHERE 
PERSONALIZATIONID=(SELECT PERSONALIZATIONID FROM 
USERS WHERE USERS_ID=(SELECT USERS_ID FROM USERREG
 WHERE LOGONID='logon_ID')) AND 
MBRGRP_ID=(SELECT MBRGRP_ID FROM MBRGRP WHERE 
MBRGRPNAME='name_of_segment')
where:
logon_ID
is the logon ID for the test customer that is created during registration
name_of_segment
is the name of the customer segment that is specified in the activity
If the query returns a row, the customer is added to the segment.

Alternatively, you can create a web activity that uses the Customer Segment target to display content, and then see whether the test customer sees the content. This activity indicates that the test customer is successfully added to the customer segment.