Liquid Course for ConvertKit

Working with Custom Fields

Learn how to use custom fields with Liquid in ConvertKit

Custom fields in ConvertKit allow you to store additional information about your subscribers beyond the default fields. This guide will show you how to effectively use custom fields with Liquid to create personalized content.

What are Custom Fields?

Custom fields are additional data points you can store for each subscriber. They're perfect for:

  • Storing subscriber preferences
  • Tracking user behavior
  • Managing course progress
  • Storing purchase history
  • Recording survey responses

Accessing Custom Fields

Basic Access

{{ subscriber.custom_fields.field_name }}

Checking if a Field Exists

{% if subscriber.custom_fields.field_name %}
  {{ subscriber.custom_fields.field_name }}
{% endif %}

Common Custom Field Types

Text Fields

{# Simple text field #}
{{ subscriber.custom_fields.interests }}
 
{# With fallback #}
{% if subscriber.custom_fields.interests %}
  {{ subscriber.custom_fields.interests }}
{% else %}
  No interests specified
{% endif %}

Number Fields

{# Basic number field #}
{{ subscriber.custom_fields.purchase_count }}
 
{# With calculations #}
{% assign next_purchase = subscriber.custom_fields.purchase_count | plus: 1 %}
Next purchase will be your {{ next_purchase }}th!
 
{# With formatting #}
{{ subscriber.custom_fields.purchase_count | round: 0 }}

Date Fields

{# Basic date field #}
{{ subscriber.custom_fields.last_purchase_date }}
 
{# With formatting #}
{{ subscriber.custom_fields.last_purchase_date | date: "%B %d, %Y" }}
 
{# With date calculations #}
{% assign days_since_purchase = "now" | date: "%s" | minus: subscriber.custom_fields.last_purchase_date | date: "%s" | divided_by: 86400 %}
It's been {{ days_since_purchase }} days since your last purchase.

Boolean Fields

{% if subscriber.custom_fields.is_premium_member %}
  Welcome back, premium member!
{% else %}
  Consider upgrading to premium for exclusive benefits.
{% endif %}

Advanced Custom Field Usage

Multiple Field Conditions

{% if subscriber.custom_fields.purchase_count > 1 and subscriber.custom_fields.last_purchase_date %}
  Thank you for being a repeat customer!
  Your last purchase was on {{ subscriber.custom_fields.last_purchase_date | date: "%B %d, %Y" }}.
{% endif %}

Field-Based Content Sections

{% case subscriber.custom_fields.membership_level %}
  {% when "premium" %}
    <div class="premium-content">
      <h2>Premium Content</h2>
      <p>Here's your exclusive premium content...</p>
    </div>
  {% when "basic" %}
    <div class="basic-content">
      <h2>Basic Content</h2>
      <p>Here's your basic content...</p>
    </div>
  {% else %}
    <div class="default-content">
      <h2>Welcome!</h2>
      <p>Choose a membership level to get started.</p>
    </div>
{% endcase %}

Progress Tracking

{% if subscriber.custom_fields.course_progress %}
  <div class="progress-tracker">
    {% assign completed = subscriber.custom_fields.course_progress.completed_lessons | size %}
    {% assign total = subscriber.custom_fields.course_progress.total_lessons %}
    {% assign percentage = completed | times: 100 | divided_by: total %}
 
    <h3>Course Progress</h3>
    <p>You've completed {{ completed }} of {{ total }} lessons ({{ percentage }}%)</p>
 
    {% if completed == total %}
      <div class="completion-badge">
        Congratulations! You've completed the course!
      </div>
    {% else %}
      <p>Next up: {{ subscriber.custom_fields.course_progress.next_lesson }}</p>
    {% endif %}
  </div>
{% endif %}

Best Practices

  1. Use Descriptive Field Names

    {# Good #}
    {{ subscriber.custom_fields.last_purchase_date }}
     
    {# Avoid #}
    {{ subscriber.custom_fields.lpd }}
  2. Always Check for Field Existence

    {% if subscriber.custom_fields.field_name %}
      {{ subscriber.custom_fields.field_name }}
    {% else %}
      Default value
    {% endif %}
  3. Use Appropriate Data Types

    • Use text fields for strings
    • Use number fields for calculations
    • Use date fields for date operations
    • Use boolean fields for true/false conditions
  4. Keep Field Names Consistent

    • Use snake_case for field names
    • Be consistent across your templates
    • Document your field names
  5. Handle Edge Cases

    {% if subscriber.custom_fields.purchase_count %}
      {% if subscriber.custom_fields.purchase_count > 0 %}
        You've made {{ subscriber.custom_fields.purchase_count }} purchases
      {% else %}
        No purchases yet
      {% endif %}
    {% else %}
      Purchase count not available
    {% endif %}

Common Use Cases

Course Progress

{% if subscriber.custom_fields.course_progress %}
  <div class="course-status">
    <h3>{{ subscriber.custom_fields.course_name }}</h3>
    <p>Current Module: {{ subscriber.custom_fields.current_module }}</p>
    <p>Progress: {{ subscriber.custom_fields.completed_lessons | size }} of {{ subscriber.custom_fields.total_lessons }} lessons</p>
  </div>
{% endif %}

Purchase History

{% if subscriber.custom_fields.last_purchase %}
  <div class="purchase-history">
    <h3>Your Last Purchase</h3>
    <p>Date: {{ subscriber.custom_fields.last_purchase.date | date: "%B %d, %Y" }}</p>
    <p>Amount: ${{ subscriber.custom_fields.last_purchase.amount }}</p>
    <p>Items: {{ subscriber.custom_fields.last_purchase.items | join: ", " }}</p>
  </div>
{% endif %}

Survey Results

{% if subscriber.custom_fields.survey_responses %}
  <div class="survey-results">
    <h3>Your Preferences</h3>
    {% for response in subscriber.custom_fields.survey_responses %}
      <p><strong>{{ response.question }}:</strong> {{ response.answer }}</p>
    {% endfor %}
  </div>
{% endif %}

Troubleshooting

  1. Field Not Showing

    • Check if the field exists
    • Verify the field name spelling
    • Ensure the field has a value
  2. Incorrect Data Type

    • Use appropriate filters for the data type
    • Convert between types when needed
    • Handle null values
  3. Performance Issues

    • Limit the number of custom fields accessed
    • Use efficient filters
    • Cache complex calculations

Next Steps

Now that you understand custom fields, you can:

  1. Create personalized email content
  2. Track user progress
  3. Segment your audience
  4. Create dynamic forms
  5. Build advanced automation workflows

Need more help? Check out our examples section for more practical implementations.

🚀 Early Access - 50% OFF

Give Your Visitors
the Proof They Need

ProofyBubble turns casual visitors into customers by leveraging social proof to build trust and credibility.

Buy once, yours forever
1-minute setup
Increase Conversion Rate
Get Lifetime Access

30-day money-back guarantee

Profile

"When I launched my course, ProofyBubble helped me get 100+ sales in the first month!"

Ankita Kulkarni • 13.2K YouTube Subscribers