diff --git a/analytics/views.py b/analytics/views.py index f428684..df6cdd8 100644 --- a/analytics/views.py +++ b/analytics/views.py @@ -88,6 +88,9 @@ def weekly_analytics(request): campaigns = Campaign.objects.filter(user=request.user, id=campaign_id) else: campaigns = Campaign.objects.filter(user=request.user) + + selected_campaign = campaigns.first() if campaign_id else None + subscriber_list = selected_campaign.subscriber_list if selected_campaign else None # Calculate date range for the past 7 days end_date = timezone.now() @@ -107,6 +110,7 @@ def weekly_analytics(request): 'delivery_rate': 0, 'open_rate': 0, 'click_rate': 0, + 'subscriber_count': 0, } # Get all email events for user's campaigns in the past 7 days @@ -151,6 +155,13 @@ def weekly_analytics(request): if delivered > 0: data['open_rate'] = round((opened / delivered) * 100, 2) data['click_rate'] = round((clicked / delivered) * 100, 2) + + if subscriber_list: + date_obj = datetime.strptime(date_str, '%Y-%m-%d').date() + day_end = timezone.make_aware(datetime.combine(date_obj, datetime.max.time())) + data['subscriber_count'] = subscriber_list.subscribers.filter( + created_at__lte=day_end + ).count() # Convert to sorted list result = sorted(daily_data.values(), key=lambda x: x['date']) diff --git a/docs/press/15. Subject - {{first_name}} {{last_name}} story idea on DripEmails.org.txt b/docs/press/15. Subject - {{first_name}} {{last_name}} story idea on DripEmails.org.txt index 00d6184..34ad50c 100644 --- a/docs/press/15. Subject - {{first_name}} {{last_name}} story idea on DripEmails.org.txt +++ b/docs/press/15. Subject - {{first_name}} {{last_name}} story idea on DripEmails.org.txt @@ -17,7 +17,7 @@ What DripEmails.org offers: - Gmail + IMAP auto-engagement workflows - Multi-step drip campaigns with flexible timing - AI-assisted drafting and revision for campaign emails -- Personalized templates with merge fields like {{first_name}}, {{last_name}}, and {{email}} +- Personalized templates with merge fields like {{first_name}} and {{email}} - Campaign analytics (opens, clicks, and engagement tracking) If useful, I can share: diff --git a/docs/press/16. Subject - {{first_name}} {{last_name}} covering smarter email follow-up at DripEmails.org.txt b/docs/press/16. Subject - {{first_name}} {{last_name}} covering smarter email follow-up at DripEmails.org.txt index fec8bca..7259627 100644 --- a/docs/press/16. Subject - {{first_name}} {{last_name}} covering smarter email follow-up at DripEmails.org.txt +++ b/docs/press/16. Subject - {{first_name}} {{last_name}} covering smarter email follow-up at DripEmails.org.txt @@ -17,7 +17,7 @@ Product highlights: - Gmail + IMAP integration for inbox-aware automation - Configurable multi-step drip sequences - AI-assisted writing and message revision -- Merge-field personalization including {{first_name}}, {{last_name}}, and {{email}} +- Merge-field personalization including {{first_name}}, and {{email}} - Engagement analytics for optimization over time Happy to provide anything useful for coverage: diff --git a/templates/campaigns/campaign_analysis.html b/templates/campaigns/campaign_analysis.html index 4eee98a..15cb8aa 100644 --- a/templates/campaigns/campaign_analysis.html +++ b/templates/campaigns/campaign_analysis.html @@ -90,7 +90,7 @@
{% trans "No subscribers found for this campaign" %}
+