Identifies the university associated with a user's email if applicable
Provides segmentation and insight for organizations with a college-aged demographic (e.g. for marketing purposes)
Code Block
import requests
import json
def transformEvent(event, metadata):
universities = json.loads(requests.request(method="GET", url="http://universities.hipolabs.com/search?country=United+States").content)
email = event["context"]["traits"]["email"]
matched_universities = [university["name"] for university in universities if email.split("@")[1] in university["domains"]]
if len(matched_universities):
university = matched_universities[0]
else:
university = None
event["context"]["traits"]["university"] = university
return event
Contact Details
amir@tradeblock.us
Language
Python
Category
Data Processing and Enrichment
Description
Code Block
Input Payload for testing
License