HomeGuidesAPI ReferenceGraphQL
Submit Documentation FeedbackJoin Developer CommunityOptimizely GitHubOptimizely NuGetLog In

Loyalty & Rewards

This topic describes how to map external data that tracks loyalty points, rewards and referrals to the Optimizely Data Platform (ODP) schema.

Events

To learn more about events and how to send them to ODP, refer to the Events section.

Event Type: loyalty

Event Action

Fields

points_added

previous_loyalty_points_balance
current_loyalty_points_balance
loyalty_change_in_points

points_added

previous_loyalty_points_balance
current_loyalty_points_balance
loyalty_change_in_points

referral_completed

loyalty_referral_code_id
loyalty_referred_customer_email

referral_link_shared

loyalty_referral_code_id
loyalty_referred_customer_email

tier_earned

previous_loyalty_tier_id
current_loyalty_tier_id

tier_lost

previous_loyalty_tier_id
current_loyalty_tier_id

yotpo_coupon_awarded

yotpo_redemption_id
yotpo_redemption_option_id
yotpo_perk_id

yotpo_coupon_redeemed

yotpo_redemption_id
yotpo_redemption_option_id

yotpo_coupon_reminder

yotpo_redemption_option_id
yotpo_points_needed

Schema

To learn more about creating Objects, Fields and Relationships and then updating newly created schema, refer to the Objects & Fields section.

Objects

Object NameDescription
Loyalty Tiers (loyalty_tiers)Stores data about available Loyalty Tiers that customers can attain via loyal actions.
Loyalty Referral Codes (loyalty_referral_codes)Stores all available referral codes and metrics on sharing.

Fields

Events (events)

Field NameTypeDescription
previous_loyalty_tier_idstringThe ID of the tier that the customer was previously associated with.
current_loyalty_tier_idstringThe ID of the tier that the customer is now associated with.
previous_loyalty_points_balancenumberThe loyalty points balance of the customer before this event.
current_loyalty_points_balancenumberThe loyalty points balance of the customer after this event.
loyalty_change_in_pointsnumberThe total change in loyalty points due to this event.
loyalty_referral_code_idstringThe unique referral code that this event applies to.
loyalty_referred_customer_emailstringThe email of the customer that was referred.

Customers (customers)

To learn more about Customers in ODP, refer to the Customers section.

Field NameTypeDescription
loyalty_points_balancenumberThe number of loyalty points that the customer currently has.
loyalty_referral_code_idstringThe unique Referral Code ID assigned to the customer.
loyalty_tier_idstringThe ID of the Loyalty Tier that the customer is associated with.
loyalty_profile_created_attsThe date & time that the customer record was created in the connected loyalty app.
loyalty_profile_updated_attsThe date & time that the customer record was last updated in the connected loyalty app.
loyalty_is_enrolled_memberbooleanIf true, the customer is currently enrolled in your loyalty program.

Loyalty Tiers (loyalty_tiers)

Field NameTypeDescription
loyalty_tier_idstringThe unique identifier for a Loyalty Tier.
namestringThe name of the Loyalty Tier.
ranknumberThe numeric rank of this Loyalty tier relative to other Loyalty Tiers.
required_dollar_spendnumberThe amount of dollars required to be spent by a customer to reach this Loyalty Tier.
descriptionstringA description of this Loyalty Tier.
required_pointsnumberThe number of points required to reach this Loyalty Tier.
required_purchasesnumberThe number of purchases required to reach this Loyalty Tier.

Loyalty Referral Codes (loyalty_referral_codes)

Field NameTypeDescription
loyalty_referral_code_idstringThe unique referral code assigned to a customer.
total_sharesnumberThe number of times that this referral code has been shared.
order_conversions_countnumberThe number of orders that have resulted from this referral code.
order_conversions_amountnumberThe dollar amount of the number of orders that have resulted from this referral code.
expiration_tstsThe date & time that the referral code expires, if it does.
is_expiredbooleanDetermines whether or not the referral code is expired.
total_clicksnumberThe total number of clicks of the shared referral code URL.
referral_urlstringThe unique referral code URL.

Relationships

NameParentChild
loyalty_referral_codeevents.loyalty_referral_code_idloyalty_referral_codes.loyalty_referral_code_id
previous_loyalty_tierevents.previous_loyalty_tier_idloyalty_tiers.loyalty_tier_id
current_loyalty_tierevents.current_loyalty_tier_idloyalty_tiers.loyalty_tier_id
loyalty_referral_codecustomers.loyalty_referral_code_idloyalty_referral_codes.loyalty_referral_code_id
loyalty_tiercustomers.loyalty_tier_idloyalty_tiers.loyalty_tier_id

Did this page help you?