HubSpot

Unlock Hyper-Personalization: Tracking Rolling Page Views in HubSpot for E-commerce

Ever wish you could send an email that says, "Hey, we noticed you visited 14 pages on our site in the last 7 days! Here's more of what you love"? That's the dream for many marketers looking to hyper-personalize their outreach. For those of us running stores or managing content, understanding recent engagement is gold. But as a recent HubSpot Community discussion revealed, turning that dream into a reality within HubSpot isn't always as straightforward as it seems.

We recently dived into a fascinating thread titled "Personalize a marketing email with website pages visited during the last x days" on the HubSpot Community. The original poster, supporting a non-profit publisher, had a clear goal: leverage HubSpot's tracking code on their external news website to personalize marketing emails. Specifically, they wanted to know the rolling count of pages visited by a contact over the past 3, 7, and 28 days. HubSpot clearly tracks individual page views, as shown in their example:

HubSpot Page View Tracking Example

The challenge was transforming this granular data into a dynamic personalization token like "Over the past 7 days you have visited 14 pages on our website." Sounds like a common use case, right? You'd think HubSpot, with its robust CRM and marketing automation, would have an out-of-the-box solution.

A developer implementing serverless functions to integrate dynamic page view data with HubSpot custom properties.
A developer implementing serverless functions to integrate dynamic page view data with HubSpot custom properties.

The HubSpot Community Weighs In: A Puzzle Without a Perfect Piece

The initial responses from the HubSpot Community confirmed the original poster's suspicion: there isn't a direct, native personalization token for rolling page view counts. A senior community moderator acknowledged the difficulty and reached out to several HubSpot experts for insight. The consensus quickly formed: while HubSpot tracks page views meticulously, extracting a dynamic, rolling count for email personalization requires ingenuity, and often, custom development.

One community member suggested a workaround involving custom contact properties and workflows. The idea was to create three custom number properties on the contact record: "Pages visited last 3 days," "Pages visited last 7 days," and "Pages visited last 28 days." These would then serve as your personalization tokens in marketing emails. The proposed workflow would run on a daily schedule, re-enrolling all contacts, and use a "Set property value" action. The challenge, however, lies in how HubSpot's native workflow actions operate.

The Limitations of Native Workflows for Dynamic Counts

While HubSpot workflows excel at segmenting contacts based on properties or recent activities, directly calculating a dynamic count of page views for each contact within a specific rolling timeframe (like "last 7 days") and writing that number to a custom property is not natively supported. As another community expert pointed out, while you can filter contacts based on "Number of page views" within a date range to create a static list, these filters are mutually exclusive and cannot be combined to dynamically update a count property for every contact in a workflow.

The proposed workaround involved creating lists that filter contacts by page views in the last X days, and then using a workflow to set a property value based on membership in that list. However, this only allows you to set a static value (e.g., "Yes, they visited pages" or "No, they didn't") or a pre-defined tier, not the actual count of pages visited. For instance, you could create a list of "Contacts who visited 10+ pages in the last 7 days" and then use a workflow to set a property like "High Engagement Last 7 Days" to "True." But getting the exact number "14" into a property for a specific contact remains elusive with native tools.

The Developer's Path: Custom Properties and Serverless Functions

Given these limitations, another community expert, a technical strategist, suggested that this use case pushes HubSpot beyond its standard build and is a job for a developer or technical strategist. This approach typically involves a combination of custom properties and serverless functions.

Here's how a custom solution might work:

  • Custom Contact Properties: You would still create the custom number properties in HubSpot (e.g., "Pages_Visited_Last_7_Days").
  • Serverless Function: This is where the magic happens. A serverless function (like AWS Lambda, Google Cloud Functions, or even HubSpot Serverless Functions for Enterprise users) would be deployed.
  • API Integration: This function would use HubSpot's APIs, specifically the Contacts API and potentially the Marketing Events API or Timeline API to query a contact's recent page view activities.
  • Logic & Calculation: The function would iterate through a list of contacts (or be triggered for individual contacts), retrieve their page view events within the specified rolling date range (e.g., last 7 days), count them, and then update the corresponding custom contact property in HubSpot via the API.
  • Scheduled Execution: This function could be triggered daily via an external cron job or a scheduled workflow in HubSpot (if using HubSpot Serverless Functions) to ensure the data is always fresh.

// Conceptual pseudo-code for a serverless function
function updatePageViews(contactId) {
    const sevenDaysAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);
    const pageViews = await hubspotAPI.getContactPageViews(contactId, sevenDaysAgo, Date.now());
    const count = pageViews.length;
    await hubspotAPI.updateContactProperty(contactId, 'pages_visited_last_7_days', count);
}

// Scheduled daily execution
contacts.forEach(c> updatePageViews(contact.id));

This approach provides the dynamic, accurate count needed for hyper-personalization, but it requires development expertise and resources.

Why Advanced Personalization is Crucial for E-commerce and Storefronts

For ESHOPMAN users and anyone looking to maximize their HubSpot investment, this level of personalization isn't just a "nice-to-have"—it's a competitive advantage. Whether you're a non-profit publisher like the original poster's client, or an e-commerce store operating on HubSpot, understanding and reacting to recent user behavior can significantly impact engagement and conversion rates.

Imagine these scenarios:

  • Targeted Product Recommendations: "You've viewed 10 product pages in the last 3 days. Here are our top sellers in those categories!"
  • Content Engagement Nudges: For publishers, "You've devoured 15 articles this week. Don't miss our latest investigative piece!"
  • Re-engagement Campaigns: If a contact's page view count drops, it could trigger an email offering a special incentive to return.
  • Advanced Lead Scoring: Incorporating rolling page view counts into your lead scoring model can provide a more dynamic and accurate assessment of a lead's current interest level.

For businesses wondering how to start selling on HubSpot for free and then scale their operations, understanding that foundational data tracking is just the beginning is key. As you grow, the demand for deeper insights and more sophisticated personalization will emerge. While HubSpot provides an incredible platform for getting started with its built-in storefront and CRM, achieving highly specific, dynamic data manipulation often requires custom integrations or development.

ESHOPMAN's Take: Bridging the Gap

At ESHOPMAN, we understand the power of HubSpot's ecosystem for e-commerce and RevOps. While HubSpot offers robust tools for tracking and basic automation, highly specific dynamic data calculations like rolling page view counts often require custom solutions. This is where a strategic approach to integrations and development becomes invaluable.

For store operators and marketers, it's essential to:

  1. Identify Your Core Needs: Clearly define what personalization data is truly critical for your business goals.
  2. Leverage Native Features First: Exhaust all possibilities with HubSpot's out-of-the-box features, lists, and standard properties.
  3. Consider Custom Development Strategically: If native tools fall short for a high-impact use case, explore custom solutions with a developer or technical partner. The ROI on hyper-personalization can often justify the investment.
  4. Focus on the Customer Experience: Ultimately, the goal is to provide a more relevant and engaging experience for your contacts, driving loyalty and sales.

While the path to dynamic rolling page view personalization in HubSpot isn't a simple drag-and-drop, it's definitely achievable with the right strategy and technical expertise. By understanding both HubSpot's native capabilities and the potential of custom integrations, you can unlock a new level of customer engagement for your storefront or content platform.

Share: