How to populate Analytics database with Content Testing experiences


Description

With a content test, we recommend that more than 100 visitors visit a page, so it can be evaluated for statistical relevancy. The article describes how to generate such a number of visits simulating visitors' behavior on the tested page, and how to check the results in the databases and using the UI.

Prerequisites

Download the XDB.RandomWalk.JMeter.jmx script found in the How to populate Analytics database with test data article.

Solution

To populate the Analytics database with Content Testing experience data, do the following:

Note: The script chooses a random link on each page to open it, and we can add a link repeatedly several times on the same page. We recommend that some percent of links on each variation refer to a page with the goal to simulate different response levels.
  1. Create the items from the templates as follows:
    1. Create the following sample items:
      • /sitecore/content/Home/Basic tests/Item in test
      • /sitecore/content/Home/Basic tests/No result
      • /sitecore/content/Home/Basic tests/Result
    2. Create the goal:
      • /sitecore/system/Marketing Control Panel/Goals/Test goal
  2. Then, proceed as follows:
    1. Set the Points field of the Test goal item to some numeric value, for example, 2.
    2. Deploy the goal.
    3. Associate the Test goal with the Result item.

  3. Publish the Basic tests folder, submit and approve the items No result and Result.

  4. In the Text field of the Item in test, add 2 links to the No result item, and 1 link to the Result item. Submit and approve the Item in test.

    Content items and Item in test, version 1
  5. In the second version of the Item in test, change the Text field, so it contains a single link to the No result item, and 3 links to the Result item.

    Test goal item and Item in test, version 2
  6. To start the content test, on the Review tab, click Approve with Test.
  7. To run the test with the predefined settings, in the Preview and start test dialog, click Start test.
  8. Run the JMeter tool and open the XDB.RandomWalk.JMeter.jmx script.
  9. Set the global parameters as follows:
    • host - your hostname
    • visitors - 101 or more
    • visits.min - 1
    • visits.max - 1
    • pagepervisit.min - 3
    • pagepervisit.max - 3
    • landingpage - /Basic tests/Item in test
  10. Run the script.

Check Results

The Test result dialog shows the data.

Test result

To ensure that the testing experiences have been added to the collection database, run the queries as follows:
SELECT *
FROM [<shard_db>].[xdb_collection].[Interactions]
where UPPER (Events) like UPPER('%<id_of_the_goal>%')
SELECT *
FROM [<shard_db>].[xdb_collection].[Interactions]
where UPPER (Events) like UPPER('%<id_of_the_tested_item>%')