askvity

What is Custom Context?

Published in Data Personalization 3 mins read

Custom contexts allow you to apply transformations to your contact data and content. Essentially, they provide a way to manipulate and format data before it's used in personalized communications, such as emails or text messages.

Deep Dive into Custom Contexts

Think of custom contexts as a bridge between your raw data and the final, polished content you want to deliver. They enable you to dynamically modify information to better suit the intended recipient and the specific communication channel.

How Custom Contexts Work

Custom contexts generally involve the use of expressions or functions that perform specific operations on your data. These operations can include:

  • Data Formatting: Reformatting dates, times, or currencies to match a particular locale or preferred style.
  • Text Manipulation: Capitalizing names, shortening lengthy strings, or replacing specific characters.
  • Conditional Logic: Displaying different content based on specific data values or criteria.
  • Data Enrichment: Assembling URLs for images or other resources based on data attributes.
  • Calculations: Performing mathematical operations on numeric data.

Examples of Custom Context in Action

Here are some concrete examples of how custom contexts might be used:

  • Personalized Greetings: Instead of a generic "Hello [Contact Name]," you can use a custom context to ensure the first letter is always capitalized, resulting in "Hello John" or "Hello Mary."
  • Date Localization: Displaying a date in the format "MM/DD/YYYY" for US recipients and "DD/MM/YYYY" for European recipients.
  • Dynamic Image URLs: Constructing image URLs based on a product ID or category, ensuring the correct image is displayed in an email. For example: https://example.com/images/[product_id].jpg where [product_id] is dynamically replaced.
  • Membership Tier Messaging: Providing customized messaging based on a customer's membership level (e.g., "As a Gold member, you receive…" vs. "As a Silver member, you receive…").

Benefits of Using Custom Contexts

  • Enhanced Personalization: Deliver more relevant and engaging content by dynamically tailoring messages to individual recipients.
  • Improved Data Consistency: Ensure data is displayed in a consistent and accurate format across all communications.
  • Increased Efficiency: Automate data manipulation tasks, saving time and reducing the risk of errors.
  • Greater Flexibility: Adapt to different communication channels and recipient preferences with ease.

In short, custom contexts give you the power to transform raw data into meaningful and personalized experiences for your audience.

Related Articles