Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In SAM, first build one or more target based on the criteria values. You can then create a random sub-target of "winners" using the options of the "duplicate" action in the target.

The randomness of the draw is based on the Random Java class. A new random seed is created, then used to create a random index generator, which is used to get n random indexes of contacts inside the source target. The target size is the size of the source target.

Code Block
final Integer randomSeed = new Random().nextInt(10000);
final Random random = new Random(randomSeed);
final Set<Integer> randomIndexes = Sets.newHashSet();
while (randomIndexes.size() < subsetTargetSize) {
    final Integer index = random.nextInt(sourceTargetSize);
    randomIndexes.add(index);
}

Purchasing window

Using contact advantages, link the "winners" to the advantage and invite them to come and purchase.

...