Phoenix Documentation
Phoenix ProductionPhoenix PreviewContentful
Primary version
Primary version
  • 🔥Phoenix 🔥
  • Installation + Usage
    • Prerequisites
    • Installation
    • Usage
  • Development
    • Architecture
      • Heroku
    • Content Types
      • Action Stats Block
      • Campaign
      • Content Block
      • Cause Page
      • Company Page
      • Current Club Block
      • Current School Block
      • Embed
      • External Link
      • Landing Page
      • Link Action
      • Metadata
      • Page
      • Photo Submission Action
      • Selection Submission Action
      • Share Action
      • Signup Referrals Block
      • Social Drive Action
      • Voter Registration Action
      • Voter Registration Drive Action
      • Voter Registration Marketing Page
      • Voter Registration Referrals Block
    • Features
      • Affiliate Opt In
      • Affiliate Scholarship Block
      • Analytics Waypoint
      • Delayed Element
      • Dismissable Element
      • Stat Card
      • General Buttons
      • Groups
      • Paginated Campaign Gallery
      • Popover Dispatcher
      • Refer A Friend
      • Referrals Gallery
      • Sitewide Banner
      • Sixpack A/B Testing
        • Code Tests
        • Contentful Tests
        • Testing Tips
      • Tooltip
      • Traffic Distribution
      • Volunteer Credits
      • Voter Registration
      • Zendesk Form
    • Contentful
      • Workflow
      • Content Management API Scripts
    • Helpers
  • Phoenix API
    • v2
      • Campaigns Resource
      • Posts Resource
      • Zendesk Endpoint
  • Data + Performance
    • Monitoring
    • Analytics
    • Logging
  • Contributing Instructions
    • Edit This Documentation
    • Glossary
Powered by GitBook
On this page
  • Overview
  • Usage Instructions
  • Under The Hood
  1. Development
  2. Features

Affiliate Opt In

PreviousFeaturesNextAffiliate Scholarship Block

Last updated 5 years ago

Overview

The Affiliate Opt In Feature consists of an Opt In Check-box displayed atop the Signup button in the Lede Banner of a campaign.

This allows a user to opt in to receiving affiliate messaging from the sponsor when signing up.

Usage Instructions

The Affiliate Opt In Content (affiliateOptInContent) Rich Text field on the Campaign Content Type in Contentful controls whether this check-box shows up, and the text that appears as the label for the check-box.

If any content is input into this field, the check-box will automatically appear above the sign-up button with the content from this field as the label.

Under The Hood

When the user clicks the "Sign up" button, we use that signups.affiliateMessagingOptIn value to determine whether we append the affiliateOptIn: true key/value pair to the details object, which is then JSON stringified and sent along to Rogue when creating the signup for the user.

Example Signup in Rogue: (note the affiliateOptIn in the details field)

{
  id: 123,
  northstar_id: "123",
  campaign_id: "123",
  campaign_run_id: null,
  quantity: null,
  quantity_pending: null,
  why_participated: null,
  source: "phoenix-next",
  source_details: null,
  details: "{"campaignContentfulId":"jkl","affiliateOptIn":true}",
  created_at: "2019-04-20 04:20:00",
  updated_at: "2019-04-20 04:20:00",
  deleted_at: null,
}

This marks this user as having opted in to receiving affiliate messaging, and can be used to help compile a list of such users for the affiliate partner.

Our state is initialized with a signups object containing an affiliateMessagingOptIn Boolean field (defaults to false). Clicking the Affiliate Opt In check box input invokes an action which toggles this value.

Redux
Affiliate Opt In Example