Badges Fact Table

Introduction to Badges Fact Tables

Badges are a type of visual recognition used in loyalty programs to reward customers for their progress, specific actions or achievements. They act as a form of gamification and instill a sense of pride and accomplishment within the user, thus, reinforcing the targeted behaviors and boosting engagement.

For more information about how badges work in Capillary product suite, please refer to the Badges Documentation. This part of the documentation covers how you can analyze and report on badges featured in the Capillary system.

There are a few crucial elements of Badges lifecycle which a user would like to track and analyze. They include events such as earning a badge (without enrolment), the issual of badge (based on enrolment) and the promotions linked with the badge. The information of these events are stored in the form of fact and dimension tables based on star schema.
The fact tables store the details of these events and the corresponding dimension tables contain the fields on the basis of which the entries in these fact tables can be grouped/filtered for reporting.

Badges - Entity Relationship Diagram (ERD)

Zoom in the table for more clarity. Click the table title to view its details.

Badges earnauto_update_time_badges_earn: bigintdim_badgeMeta_id: stringdim_badges_earn_active_id: bigintdim_badges_owner_type_id: stringdim_createdOn_date_id: bigintdim_createdOn_id: bigintdim_customer_id: bigintdim_event_date_id: bigintdim_event_time_id: bigintdim_expiresOn_date_id: bigintdim_expiresOn_id: bigintdim_latest_updated_date_id: bigintdim_latest_updated_time_id: bigintPKearnId: stringisActive: stringlastUpdatedBy: bigintownerReferenceId: stringyear: intBadges issueauto_update_time_badges_issue: bigintPKbadges_issued_id: stringcreatedBy: bigintdim_badgeMeta_id: stringdim_badges_issue_active_id: bigintdim_badges_owner_type_id: stringdim_createdOn_date_id: bigintdim_createdOn_id: bigintdim_customer_id: bigintdim_event_date_id: bigintdim_event_time_id: bigintdim_expiresOn_date_id: bigintdim_expiresOn_id: bigintdim_latest_updated_date_id: bigintdim_latest_updated_time_id: bigintisActive: stringlastUpdatedBy: bigintownerReferenceId: stringrequestId: stringyear: intBadges earn benefitsallocationStrategyId: bigintauto_update_time_badges_benefits_earn: bigintbenefitType: stringcouponCode: stringdescription: stringdim_badgeMeta_id: stringdim_coupon_series_id: stringdim_customer_id: bigintdim_event_date_id: bigintdim_event_time_id: bigintdim_latest_updated_date_id: bigintdim_latest_updated_time_id: bigintdim_validTill_id: bigintdiscountCode: stringdiscountType: stringearnId: stringexpirationStrategyId: bigintnotes: stringpointsEarned: bigintprogramId: bigintpromoIdentifier: stringpromotionId: stringpromotionName: stringstatusCode: intPKuniqueId: stringyear: intBadges EarnBadges IssueBadges Earned BenefitsbadgemetabadgeRank: stringgroupRank: stringexpiresOn: bigintisActive: stringstartOn: bigintLKbadgeMetaId: stringearnType: stringbadgeName: stringgroupName: stringgroupIsActive: stringbadgeGroupId: stringbadges_owner_typeLKid: intvalue: stringcoupon_seriespurpose: stringdiscount_type: stringdescription: stringLKcoupon_series_id: bigintauto_update_campaign_base: bigintowner_valid_till_date: stringmetadata: stringcampaign: stringclient_handling_type: stringdiscount_value: stringauto_update_voucher_series: bigintcampaign_id: bigintexpiry_strategy_type: stringvalid_till_date: stringseries_type: stringseries_id: bigintdiscount_code: stringexpiry_strategy_value: stringauto_update_owner_info: bigintauto_update_owner_info: bigintusersauto_update_merged_customer: bigintauto_update_loyalty: bigintfraud_status: stringtest_control_bucket: stringis_merged_customer: stringsubscription_status_email_bulk: stringfirst_name: stringslab_name: stringsubscription_status_wechat_bulk: stringemail: stringlast_name: stringmerged_user_id: bigintLKuser_id: bigintsubscription_status_wechat_trans: stringsubscription_status_sms_bulk: stringndnc_status: stringsubscription_status_email_trans: stringtest_control_status: stringauto_update_fraud_user: bigintis_inactive: stringsource: stringslab_number: intauto_update_users: bigintregistered_till_id: bigintauto_update_customer_enrollment: bigintslab_expiry_date: stringcustomer_external_id: stringsubscription_status_sms_trans: stringmobile: stringloyalty_type: stringauto_update_ndnc_status: bigintdateLKdate_id: intday_of_month: intweek_of_year: intmonth: stringyear: intquarter: stringweek_number: intweek_start_date: stringweek_end_date: stringday_of_week: stringmonth_no: intmonth_no_of_year: intmonth_of_year: stringday_of_week_no: intquarter_no: intyearly_quarter_no: intdate: stringDateCoupon SeriesBadges Owner TypeUsersBadge Metabadges_owner_typeLKid: intvalue: stringEnabledTimeLKtime_id: biginttime: stringhour_of_day: intminute_of_day: intday_shift: stringday_shift_no: inthour_range: stringTime

Legend

PK   Primary Key

LK   Linking Key

Fact Table
Dimension Table

Badges - Earn (badges_earn)

Each row in this table represents an event in which a customer earns a badge on completing a specified activity or meeting a set of pre-defined criteria. This doesn’t require the customer to enrol for the badge beforehand. It captures information like the badge ID, customer ID, earning date, expiry date, and whether the badge is active or revoked.

For example-
When a customer registers, they automatically receive the "New Member" badge if the configuration specifies that pre-enrollment is not needed. These types of events are stored in the Badges_earn fact table.
By linking this fact table with the dimension tables, you would be able to have a complete picture of this event.

Databricks Table Name: badges_earn

Badges Earn Fact Table

Column nameData typeDescriptionLinked TableAvailability for Export in the Badges Earn Template
auto_update_time_badges_earnbigintDate and time when the badges_earn table was last updated. It is in the Unix timestamp format. The update takes place only when the badge deactivation occurs._Yes; Measure Name: Auto Update Time Badges Earn
dim_badgeMeta_idstringUnique identifier assigned to a badge when it is generated. It is a common key that connects to the badgeMeta dimension table for providing badge details.badgemetaYes; Dimension Name: Badgemeta
dim_badges_earn_active_idbigintIndicates if the badge is currently active or not.enabledYes; Dimension Name: Badges Earn Active
dim_badges_owner_type_idstringProvides information about the module (name) that granted the customer a particular badge. For instance, if the badge was awarded by the Journeys module, you can retrieve Journeys module details by linking to the badges_owner_type field using this column. The types of modules are - Loyalty/ Referral_Campaigns/ Journeys/ Auidence_Campaigns/ Rewards_Catalog/ Goodwill_Module/ Milestones.badges_owner_typeYes; Dimension Name: Badges Owner Type
dim_createdOn_date_idbigintDate on which the badge was earned by the customer.dateYes; Dimension Name: Date
dim_createdOn_idbigintTime when the badge was earned by the customer.timeYes; Dimension Name: Time
dim_customer_idbigintUnique identifier for the customer associated with the badge.usersYes; Dimension Name: Customer user Id
dim_event_date_idbigintDate on which the badge was earned.dateYes; Dimension Name: Date
dim_event_time_idbigintTime when the badge was earned.timeYes; Dimension Name: Time
dim_expiresOn_date_idbigintDate on which the badge expires.dateYes; Dimension Name: Date
dim_expiresOn_idbigintTime when the badge expires.timeYes; Dimension Name: Time
dim_latest_updated_date_idbigintDate when the table was last updated.dateYes; Dimension Name: Date
dim_latest_updated_time_idbigintTime when the table was last updated.timeYes; Dimension Name: Time
earnIdstringUnique identifier assigned to each row of the earn badges fact table. It is the primary key of this table. It is useful in accessing information related to the customer, badge earn date, badge expiration details, etc._Yes; Measure Name: Earnid
isActivestringIndicates if the badge is currently active or not._Yes; Measure Name: Isactive
lastUpdatedBybigintIdentifier of the user who last updated the badge. It could be a brand representative, a Customer Success Manager (CSM), or someone similar._Yes; Measure Name: Lastupdatedby
ownerReferenceIdstringOrchestered ID assigned to the module responsible for awarding the badge, e.g, milestone id, journey id, campaign id, loyalty id, etc._Yes; Measure Name: Ownerreferenceid
yearintYear of the event._Yes; Dimension Name: Year

Badges - Issue (badges_issue)

Each row in this table represents the event, where the customer has to enrol in the badge before they can earn it. It captures information like the badge ID, customer ID, issuance date, expiry date, and whether the badge is active or revoked.

For example-
A brand launches a campaign to ensure proactive engagement. In this campaign, the first 1000 participants would have the opportunity to become premium members. As configured, the "premium member" badge requires pre-enrollment. Therefore, such types of events are stored in this table.

Databricks Table Name: badges_issue

Badges Issue Fact Table

Column NameData TypeDescriptionLinked TableAvailability for Export in the Badges Issue Template
auto_update_time_badges_issuebigintDate and time when the badges_issue table was last updated. It is in the Unix timestamp format. The update takes place only when the badge deactivation occurs._Yes; Measure Name: Auto Update Time Badges Issue
badges_issued_idstringIt is an unique identifier for the 'badges issued' fact table. As a primary key, it uniquely identifies each record or entry within the table. It allows tracking and analysis of individual badge issuance events._Yes; Measure Name: Badges Issued Id
createdBybigintIdentifier of the user who issued the badge, such a brand representative._Yes; Measure Name: Createdby
dim_badgeMeta_idstringUnique identifier assigned to a badge when it is generated. It is a common key that connects to the badgeMeta dimension table for providing badge details.badgemetaYes; Dimension Name: Badgemeta
dim_badges_issue_active_idbigintIndicates whether the badge is currently active or not.enabledYes; Dimension Name: Badges Issue Active
dim_badges_owner_type_idstringProvides information about the module (name) that granted the customer a particular badge. For instance, if the badge was awarded by the Journeys module, you can retrieve Journeys module details by linking to the badges_owner_type field using this column. The types of modules are - Loyalty/ Referral_Campaigns/ Journeys/ Auidence_Campaigns/ Rewards_Catalog/ Goodwill_Module/ Milestones.badges_owner_typeYes; Dimension Name: Badges Owner Type
dim_createdOn_date_idbigintDate when the badge was issued to the customer.dateYes; Dimension Name: Date
dim_createdOn_idbigintTime when the badge was issued to the customer.timeYes; Dimension Name: Time
dim_customer_idbigintUnique identifier for the customer associated with the badge.usersYes; Dimension Name: Customer user Id
dim_event_date_idbigintDate on which the badge was issued.dateYes; Dimension Name: Date
dim_event_time_idbigintTime when the badge was issued.timeYes; Dimension Name: Time
dim_expiresOn_date_idbigintDate on which the badge expires.dateYes; Dimension Name: Date
dim_expiresOn_idbigintTime when the badge expires.timeYes; Dimension Name: Time
dim_latest_updated_date_idbigintDate when the table was last updated.dateYes; Dimension Name: Date
dim_latest_updated_time_idbigintTime when the table was last updated.timeYes; Dimension Name: Time
isActivestringIndicates whether the badge is currently active or not._Yes; Measure Name: Isactive
lastUpdatedBybigintIdentifier of the user who last updated the badge. It could be a brand representative, a Customer Success Manager (CSM), or someone similar._Yes; Measure Name: Lastupdatedby
ownerReferenceIdstringOrchestered ID assigned to the module responsible for awarding the badge, e.g. milestone id, journey id, campaign id, loyalty id, etc._Yes; Measure Name: Ownerreferenceid
requestIdstringIt is a request ID generated during the issue of a badge. This ID serves as a reference point for tracking and managing the issuance of badges._Yes; Measure Name: Requestid
yearintYear of the event._Yes; Dimension Name: Year

Badges - Earned Benefits (badges_earned_benefits)

Each row in this table represents the event, wherein the promotions or benefits are linked to the badge. It captures information on the benefit type, coupon code, points earned, and validity of the benefit that comes along.

For example-
A brand wants to run a campaign where customers who purchase items worth Rs. 10,000 during the campaign will earn a "Super Customer" badge. Additionally, the brand will provide extra coupons to "Super Customers." Here, the event of badge creation is linked to a promotion, and thus such events will be captured in this table.

Databricks Table Name: badges_earned_benefits

Badges Earned Benefits Fact Table

Column NameData TypeDescriptionLinked TableAvailability for Export in the Badges Earned Benefits Template
allocationStrategyIdbigintDenotes the strategy selected to allocate points for badges. In case of tier-based allocation, points are allocated according to predefined tiers or categories._Yes: Measure Name: Allocationstrategyid
auto_update_time_badges_benefits_earnbigintDate and time when the badges_benefits_earn table was last updated. It is in the Unix timestamp format. The update takes place only when the badge deactivation occurs._Yes: Measure Name: Auto Update Time Badges Benefits Earn
benefitTypestringType of benefit linked to the badge. The benefit types are: coupons and points._Yes: Measure Name: Benefittype
couponCodestringThe coupon code associated with the benefit. It is generated by the coupons system._Yes: Measure Name: Couponcode
descriptionstringDescription of the coupon._Yes: Measure Name: Description
dim_badgeMeta_idstringUnique identifier assigned to a badge when it is generated. It is a common key that connects to the badgeMeta dimension table for providing badge details.badgemetaYes; Dimension Name: Badgemeta
dim_coupon_series_idstringUnique identifier for coupon series id. Whenever a coupon is generated, it is allocated a unique coupon series ID. It links to the coupon series dimension table, establishing a relationship between the benefits earned and the details of the coupon series.coupon_seriesYes; Dimension Name: Coupon Series
dim_customer_idbigintUnique identifier for the customer associated with the badge.usersYes; Dimension Name: Customer user Id
dim_event_date_idbigintDate on which the benefit (coupon or point) was earned.dateYes; Dimension Name: Date
dim_event_time_idbigintTime when the benefit (coupon or point) was earned.timeYes; Dimension Name: Time
dim_latest_updated_date_idbigintDate when the table was last updated.dateYes; Dimension Name: Date
dim_latest_updated_time_idbigintTime when the table was last updated.timeYes; Dimension Name: Time
dim_validTill_idbigintDenotes the coupon validity date.dateYes; Dimension Name: Validtill
discountCodestringDiscount code associated with the coupon series._Yes; Measure Name: Discountcode
discountTypestringType of discount. Can be ABS - absolute discount type where the discount value is fixed, or percent discount or a fixed discount._Yes; Measure Name: Discounttype
earnIdstringUnique identifier for the badges_earn table._Yes; Measure Name: Earnid
expirationStrategyIdbigintDenotes the strategy used for deciding how points expire for the customer, such as fixed expiry date, or no expiry, etc._Yes; Measure Name: Expirationstrategyid
notesstringProvides additional information or remarks related to badges._Yes; Measure Name: Notes
pointsEarnedbigintPoints earned by the customer._Yes; Measure Name: Pointsearned
programIdbigintThe Loyalty program ID is the identifier assigned to the loyalty program linked to the allocated points._Yes; Measure Name: Programid
promoIdentifierstringUnique identifier assigned to a promotion._Yes; Measure Name: Promoidentifier
promotionIdstringUnique id assigned to a particular promotion._Yes; Measure Name: Promotionid
promotionNamestringRefers to the name of the promotion to which points were allocated, redeemed, or expired._Yes; Measure Name: Promotionname
statusCodeintStatus code for the action (used for internal purpose)._Yes; Measure Name: Statuscode
uniqueIdstringUnique identifier for the table. As a primary key, it uniquely identifies each record or entry within the table. It allows tracking and analysis of individual badge benefits events._Yes; Measure Name: Uniqueid
yearintYear of the event._Yes; Dimension Name: Year