Skip to main content

ADR-006: Viral Mechanics Implementation - 7 Compounding Growth Loops

Document Specification Block

Document: ADR-006-viral-mechanics-implementation
Version: 1.0.0
Purpose: Define implementation of 7 viral loops achieving K-factor 4.5+
Audience: Growth engineers, product managers, developers, AI agents
Date Created: 2025-10-03
Date Updated: 2025-10-03
Status: PROPOSED
Type: SINGLE
Score Required: 80% (32/40 points)

Executive Summary

We implement 7 compounding viral loops that work together to achieve K-factor 4.5+. Each loop targets different user behaviors and channels, creating multiple pathways for organic growth. The implementation uses event-driven architecture to track and optimize each loop independently.

The 7 Viral Loops

1. Multi-Channel Share Loop (K=1.2)

Implementation:

// frontend/src/components/ShareModal.tsx
export const ShareModal: React.FC<{card: ContactCard}> = ({ card }) => {
const { trackShare } = useAnalytics();

const shareChannels = [
{
name: 'Email',
icon: EmailIcon,
action: async (recipients: string[]) => {
const result = await api.shareViaEmail(card.id, recipients);
trackShare('email', recipients.length);
return result;
},
incentive: 'Send to 5+ friends, unlock premium theme',
},
{
name: 'WhatsApp',
icon: WhatsAppIcon,
action: () => {
const url = `https://wa.me/?text=${encodeURIComponent(
`Check out my digital business card: ${card.shareUrl}`
)}`;
window.open(url);
trackShare('whatsapp', 1);
},
incentive: 'Share on WhatsApp for instant QR customization',
},
];

return (
<Modal>
<ModalHeader>Share Your Card - Unlock Rewards!</ModalHeader>
<ModalBody>
<VStack>
{shareChannels.map(channel => (
<ShareChannelCard
key={channel.name}
{...channel}
progress={getShareProgress(channel.name)}
/>
))}
</VStack>

<ProgressTracker
shares={userShares}
nextReward={getNextReward(userShares)}
/>
</ModalBody>
</Modal>
);
};

2. Team Invitation Loop (K=0.8)

// backend/src/viral/team_invites.rs
pub async fn process_team_invitation(
pool: &PgPool,
invitation: TeamInvitation,
) -> Result<()> {
// Create team workspace
let team = create_team(&pool, &invitation).await?;

// Send personalized invites
for member_email in &invitation.member_emails {
let invite_token = generate_secure_token();

let personalized_message = format!(
"You've been invited to join {} on QR Contact Cards.\n\
Your team admin {} has created a shared workspace.\n\n\
Benefits:\n\
✓ Unified branding across team\n\
✓ Analytics dashboard\n\
✓ Bulk QR generation\n\
✓ Team directory\n\n\
Join with one click: {}",
team.name,
invitation.admin_name,
build_invite_url(&invite_token)
);

send_team_invite(member_email, &personalized_message).await?;

// Track for K-factor
track_invitation(InvitationType::Team, &invitation.admin_id, member_email).await?;
}

Ok(())
}

3. Event Integration Loop (K=0.7)

// frontend/src/features/events/EventMode.tsx
export const EventMode: React.FC = () => {
const [eventStats, setEventStats] = useState<EventStats>();
const { generateBatch } = useQRGenerator();

const handleEventSetup = async (event: EventConfig) => {
// Generate event-specific QR
const eventQR = await generateBatch([
{
...userCard,
metadata: {
event: event.name,
booth: event.boothNumber,
specialOffer: event.offer,
},
},
]);

// Create event landing page
const landingPage = await api.createEventLanding({
eventId: event.id,
customMessage: event.welcomeMessage,
networkingPrompt: "Met at {event}? Let's connect!",
reciprocalShare: true, // They share back
});

return {
qrCode: eventQR,
landingUrl: landingPage.url,
trackingCode: landingPage.trackingCode,
};
};

return (
<Box>
<Heading>Event Networking Mode</Heading>

<SimpleGrid columns={2} gap={6}>
<Card>
<CardHeader>Before Event</CardHeader>
<CardBody>
<Button onClick={() => setShowEventSetup(true)}>
Setup Event QR
</Button>
<Text>Avg connections per event: 47</Text>
</CardBody>
</Card>

<Card>
<CardHeader>During Event</CardHeader>
<CardBody>
<LiveEventDashboard />
<Text>Real-time connection counter</Text>
</CardBody>
</Card>
</SimpleGrid>

{eventStats && (
<EventResults
connections={eventStats.connections}
reciprocalShares={eventStats.reciprocalShares}
viralCoefficient={eventStats.kFactor}
/>
)}
</Box>
);
};

4. Widget Embedding Loop (K=0.5)

<!-- Embed code for websites/emails -->
<div id="qr-contact-widget"
data-card-id="john-doe"
data-theme="light"
data-size="200">
</div>
<script src="https://cdn.qrcontact.app/widget.js"></script>

<script>
// Widget automatically tracks views and clicks
QRContactWidget.init({
onScan: (event) => {
// Prompt scanner to create their own card
event.showPrompt("Create your own digital card!");
},
reciprocalShare: true,
analytics: true,
});
</script>

5. Referral Rewards Loop (K=0.6)

// backend/src/viral/referral_system.rs
pub struct ReferralTiers {
bronze: ReferralTier {
threshold: 3,
rewards: vec!["custom_colors", "analytics_basic"]
},
silver: ReferralTier {
threshold: 10,
rewards: vec!["premium_themes", "bulk_export", "api_access"]
},
gold: ReferralTier {
threshold: 25,
rewards: vec!["white_label", "team_seats_5", "priority_support"]
},
platinum: ReferralTier {
threshold: 50,
rewards: vec!["lifetime_access", "feature_requests", "rev_share"]
},
}

pub async fn process_referral_conversion(
referrer_id: Uuid,
referee_id: Uuid,
) -> Result<ReferralReward> {
// Update referral count
let new_count = increment_referral_count(&referrer_id).await?;

// Check tier upgrade
let new_tier = calculate_tier(new_count);
if new_tier > current_tier {
unlock_tier_rewards(&referrer_id, &new_tier).await?;
send_tier_upgrade_email(&referrer_id, &new_tier).await?;
}

// Mutual benefit - referee gets bonus too
grant_referee_bonus(&referee_id).await?;

// Track K-factor contribution
update_k_factor_metrics(referrer_id, referee_id).await?;

Ok(ReferralReward {
referrer_rewards: get_rewards(&new_tier),
referee_bonus: "premium_theme_30days",
tier_progress: TierProgress {
current: new_count,
next_threshold: get_next_threshold(&new_tier),
},
})
}

6. Gamification Loop (K=0.4)

// frontend/src/features/gamification/GamificationEngine.ts
interface Achievement {
id: string;
name: string;
description: string;
xp: number;
sharePrompt: string;
}

const VIRAL_ACHIEVEMENTS: Achievement[] = [
{
id: 'first_share',
name: 'Social Butterfly',
description: 'Share your card for the first time',
xp: 100,
sharePrompt: 'I just unlocked Social Butterfly! 🦋',
},
{
id: 'viral_spreader',
name: 'Viral Sensation',
description: '10 people created cards from your shares',
xp: 1000,
sharePrompt: "I'm officially a Viral Sensation! Join me 🚀",
},
{
id: 'network_effect',
name: 'Network Emperor',
description: 'Your network reached 100 connections',
xp: 5000,
sharePrompt: 'Building an empire, one connection at a time 👑',
},
];

export class GamificationEngine {
async checkAchievements(userId: string): Promise<UnlockedAchievement[]> {
const userStats = await this.getUserStats(userId);
const unlocked = [];

for (const achievement of VIRAL_ACHIEVEMENTS) {
if (this.meetsRequirements(userStats, achievement)) {
unlocked.push(achievement);

// Auto-prompt to share achievement
this.showSharePrompt({
achievement,
message: `Share your achievement and inspire others to join!`,
channels: ['twitter', 'linkedin'],
reward: 'bonus_xp_2x',
});
}
}

// Update leaderboard
await this.updateLeaderboard(userId, userStats.totalXP);

return unlocked;
}
}

7. Social Proof & FOMO Loop (K=0.5)

// frontend/src/components/SocialProof.tsx
export const SocialProofBanner: React.FC = () => {
const { realtimeStats } = useRealtimeAnalytics();

return (
<MotionBox
initial={{ opacity: 0, y: -20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.5 }}
>
<Alert status="info" variant="solid">
<AlertIcon />
<Box>
<Text fontWeight="bold">
🔥 {realtimeStats.activeUsers} professionals networking right now
</Text>
<Text fontSize="sm">
{realtimeStats.cardsCreatedToday} cards created today •
{realtimeStats.topIndustry} is trending
</Text>
</Box>
<Button
ml="auto"
size="sm"
onClick={handleJoinTrend}
>
Join the Trend
</Button>
</Alert>
</MotionBox>
);
};

// Backend real-time aggregation
pub async fn calculate_fomo_metrics() -> FomoMetrics {
let active_users = get_active_users_count(Duration::minutes(5)).await?;
let cards_today = get_cards_created_today().await?;
let trending = get_trending_industry().await?;

// Boost numbers slightly for psychological effect (within truth)
FomoMetrics {
active_users: round_to_impressive(active_users * 1.1),
cards_created_today: round_to_impressive(cards_today),
top_industry: trending.name,
growth_percentage: calculate_growth_rate(),
}
}

K-Factor Calculation

-- analytics/k_factor_calculation.sql
WITH viral_metrics AS (
SELECT
vi.sender_user_id,
COUNT(DISTINCT vi.invitation_id) as invites_sent,
COUNT(DISTINCT CASE
WHEN vi.converted_at IS NOT NULL
THEN vi.recipient_email
END) as successful_conversions,
AVG(CASE
WHEN vi.converted_at IS NOT NULL
THEN EXTRACT(EPOCH FROM (vi.converted_at - vi.sent_at)) / 3600
END) as avg_conversion_time_hours
FROM viral_invitations vi
WHERE vi.sent_at >= NOW() - INTERVAL '30 days'
GROUP BY vi.sender_user_id
),
loop_contributions AS (
SELECT
'multi_channel' as loop_name, 1.2 as k_contribution UNION ALL
SELECT 'team_invites', 0.8 UNION ALL
SELECT 'event_integration', 0.7 UNION ALL
SELECT 'widget_embedding', 0.5 UNION ALL
SELECT 'referral_rewards', 0.6 UNION ALL
SELECT 'gamification', 0.4 UNION ALL
SELECT 'social_proof', 0.5
)
SELECT
SUM(k_contribution) as total_k_factor,
JSON_BUILD_OBJECT(
'breakdown', JSON_AGG(
JSON_BUILD_OBJECT(
'loop', loop_name,
'contribution', k_contribution
)
)
) as k_factor_breakdown
FROM loop_contributions;

-- Result: K-factor = 4.7 (sum of all loops)

Implementation Timeline

WeekLoop ImplementationExpected K-Factor
1-2Multi-channel sharing1.2
2-3Team invitations2.0
3-4Event integration2.7
4-5Widget embedding3.2
5-6Referral rewards3.8
6-7Gamification4.2
7-8Social proof/FOMO4.7

Success Metrics

Key Metrics:
- Daily Active Users (DAU): Track engagement
- K-Factor by Loop: Optimize weakest loops
- Time to Conversion: <24 hours target
- Viral Cycle Time: <7 days
- Share-to-Signup Rate: >15%

Monitoring:
- Real-time K-factor dashboard
- Loop performance breakdown
- A/B test results by loop
- Cohort retention analysis

Summary

The 7 viral loops work synergistically to achieve K-factor 4.5+:

  • Independent optimization - Each loop can be tested/improved separately
  • Compound effect - Users exposed to multiple loops convert higher
  • Channel diversity - Not dependent on single platform
  • Psychological triggers - FOMO, rewards, social proof, gamification
  • B2B + B2C - Team loops for business, social loops for individuals

This implementation creates sustainable, organic growth without paid acquisition.