Skip to main content
Tracking custom activities on Magento
Success team avatar
Written by Success team
Updated over a week ago

Note: This guide is compatible with version 1.3.1 and above of the LoyaltyLion Magento extension. If you're running an older version, contact support@loyaltylion.com for an upgrade guide.


 In this guide, we'll set up a hypothetical "signed up for a newsletter" custom activity on a Magento store.

2. Configure the rule settings. For this rule, we'll choose the following values:

  • Identifier will be 'newsletter_signup' - this can be anything, but we'll use it later in our Magento code.

  • We'll award 50 points for completing this activity

  • We'll choose 'Immediate' - so the points don't have a pending period

  • Points will be earned at most once per year - but we'll only send an event for this activity once per customer anyway.

3. Track events in our Magento store

// Construct our event payload 
// This is described here:
// https://loyaltylion.com/docs/tracking-activities-and-orders $data = array(
       'customer_id' => $customer->getId(),
       'customer_email' => $customer->getEmail(),
       'date' => date('c'),
     );
// get a LoyaltyLion API client using the API credentials you have set in your store $client = Mage::helper('loyaltylion/client')->client();
// Track a newsletter signup event
$client->events->track('newsletter_signup', $data);

4. Verify that the customer earned their points.

Did this answer your question?