The Campaign Service data model stores the code generation rules, the actual codes, and the audit trail for when codes are used.
Each time codes are generated, a code generator record is created with the instructions used in the code generation process.
Field | Description |
---|---|
ID |
Unique Id for the Code Generator |
CODE_PREFIX |
Code prefix used in code generation, typically defaults to the campaign code prefix |
NUMBER_TO_GENERATE |
Number of unique codes to generate |
NUMBER_GENERATED |
Updated as each batch of codes is created to reflect progress towards the goal |
STATUS |
The status of the code generation (PENDING, IN_PROCESS, SUCCESS, ERROR, CANCELLED) |
CODE_FORMAT |
A format string that can be used to control the characters used in code |
CODE_LENGTH |
Use to specify the desired length of the code (alternative to code-format) |
MAX_USES |
Typically set to 1 if each code can only be used once |
CREATE_DATE |
Date code generation was created |
UPDATE_DATE |
Date code generation was last updated |
MESSAGE |
? |
EMAIL_REGEX |
Stores a qualifying customer email regex if the codes are restricted to be used by a specific email pattern |
ACTIVE_START_DATE |
Start date the code is active (leave blank to default to campaign dates) |
ACTIVE_END_DATE |
End date the code is active (leave blank to default to campaign dates) |
CAMPAIGN_ID |
Foreign key to the containing campaign record |
Stores the actual codes for this campaign
Field | Description |
---|---|
ID |
Unique Id for code |
CODE |
The generated code |
ACTIVE_START_DATE |
Start date the code is active |
ACTIVE_END_DATE |
End date the code is active |
MAX_USES |
Typically set to 1 if each code can only be used once |
EMAIL_REGEX |
Stores a qualifying customer email regex if the code are restricted to be used by a specific email or pattern |
CAMPAIGN_ID |
Foreign key to the containing campaign record |
GENERATOR_ID |
Foreign key to the containing generator |
The Campaign object provides a wrapper for all of the codes that are generated.
Field | Description |
---|---|
ID |
Unique Id for the Campaign |
NAME |
Name of this campaign |
CODE_PREFIX |
The prefix that will be used for any generated codes. It is best to use a unique prefix for each campaign to avoid code collisions |
ACTIVE_START_DATE |
Start date the campaign is active |
ACTIVE_END_DATE |
End date the campaign is active |
Stores the actual uses of the code
Field | Description |
---|---|
ID |
Unique Id for code |
CAMPAIGN_CODE |
The code that was used |
CAMPAIGN_TRACKING_ID |
The campaign id for this audit |
TARGET_VALUE |
Value of the audited user |
TARGET_TYPE |
Target type (audits are driven by the UserTarget that uses the code, typically CustomerId but could be email or other identifier). |
DATE_APPLIED |
Date the audit was recorded |