Liquid API
activity_feed
Access the customer's recent activity and engagement events.
Syntax
customer.metafields.lantern.activity_feedDescription
The activity_feed metafield contains the customer's recent activity events for display in customer dashboards or activity summaries. This includes metrics-tracked events like purchases, referrals, and other engagement activities.
The activity feed metafield contains JSON data that must be parsed using Liquid's parse_json filter before accessing individual properties.
Properties
Type: JSON Object
Namespace: lantern
Return Values
| Scenario | Value | Type |
|---|---|---|
| Customer has activity events | Activity feed object | JSON Object |
| Customer has no activity | {"events": []} (empty events array) | JSON Object |
| Logged out | null | null |
Activity Feed Structure
Prop
Type
Event Object Structure
Each event in the events array contains:
Prop
Type
Examples
Basic Activity Display
{% assign activity_data = customer.metafields.lantern.activity_feed %}
{% if activity_data %}
{% assign activity = activity_data | parse_json %}
{% if activity.events.size > 0 %}
<div class="activity-feed">
<h3>Recent Activity</h3>
{% for event in activity.events %}
<div class="activity-item">
<h4>{{ event.metric.name }}</h4>
<p>{{ event.timestamp | date: '%B %d, %Y' }}</p>
</div>
{% endfor %}
</div>
{% endif %}
{% endif %}