Affiliate Scholarship Block
Overview
A sizable amount of site traffic are referrals from affiliate partners -- usually scholarship listing platforms such as Fastweb.
The Affiliate Scholarship Block displays a card on the Campaign Landing Page containing the referring affiliate partner's logo, title, as well as some pertinent scholarship information.

Usage Instructions
There are a few separate components controlling what is displayed in the card, as well as controlling whether or not the card will show up for the user:
UTM Parameters
The URL for the current user will need to contain the following UTM parameters:
utm_source
with a value containing the wordscholarship
. e.g.utm_source=scholarship_listing
utm_campaign
with the value of the referring affiliate's UTM label e.g.utm_campaign=fastweb
(explained more below). If the value is a snakecased string, the value should be the _first single value in the string e.g.utm_campaign=fastweb_2019_07
.
Affilite info
A Contentful Affiliate entry containing the following fields:
UTM Label (
utmLabel
) matching theutm_campaign
(or the first value in a snake_casedutm_campaign
parameter) in the URL.Title
Logo
The UTM Label should exactly match the utm_campaign
(or first value in a snake_cased utm_campaign
parameter), since that's what's used to find the affiliate entry in Contentful. (We've employed a measure to control for mistakenly uppercased values in the utm_campaign
-- those will be down-cased before searching Contentful.)
Campaign Scholarship Info
The Campaign entry in Contentful must have the following fields filled in:
Scholarship Amount (
scholashipAmount
)Scholarship Deadline (
scholarshipDeadline
)
Under The Hood
The LandingPage
will pass through the campaign scholarship fields to the PitchTemplate
component. The component then employs the getAffiliateScholarshipLabel
helper method to check that the utm_source
contains the word scholarship
, and if so, returns the parsed value of the utm_campaign
.
If this value is returned, and the scholarship fields are present, the component renders the AffiliateScholarshipBlockQuery
component which uses GraphQL to query for the Affiliate entry matching the parsed utm_campaign
value.
It then renders the AffiliateScholarshipBlock
component with all the information.
If the query encounters an error, or if no affiliate is found, the AffiliateScholarshipBlock
component will still be rendered absent the affiliate logo and title. (Since under the current conditions we presume the user to benefit from the featured scholarship information.)
Last updated