Skip to content

Instantly share code, notes, and snippets.

@Kevinlearynet
Last active July 19, 2021 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kevinlearynet/6ebb4dfe02367ea1287db8a42fbc82e9 to your computer and use it in GitHub Desktop.
Save Kevinlearynet/6ebb4dfe02367ea1287db8a42fbc82e9 to your computer and use it in GitHub Desktop.
Specification for creating a "Application Updated" event sent in to Segment by TAP/ArrayWorks.
Analytics.Client.Identify("{UserID}", new Traits() {
{ "id", "{UserID}" },
{ "firstName", "Kevin" },
{ "lastName", "Leary" },
{ "email", "info@kevinleary.net" },
{ "age", 35 },
{ "birthday", "1986-04-22" },
{ "createdAt", "YYYY-MM-DD" }, // Date of initial "application sent"
{ "gender", "Male" },
{ "phone", "7814896630" },
{ "address", {
{ "street", "110 Main Street" },
{ "city", "Woburn" },
{ "state", "MA" },
{ "postalCode", "01801" },
{ "country", "USA" },
} }
});
Analytics.Client.Track("{UserID}", "Application Updated", new Properties() {
{ "UserID", "{UserID}" },
{ "Address1", "15 Sherman Street, Apt. 1" },
{ "Address2", "" },
{ "ApplicationEntityID", 1328531 },
{ "ApplicationSentDate", "" },
{ "CaseStatus", "Committed" },
{ "City", "Natick" },
{ "ClientStatus", "Lead" },
{ "CoverageAmount", 350000 },
{ "CurrentStatus", "Complete" },
{ "CurrentStatusDate", "7/19/2021 3:07:57 PM" },
{ "Email", "stephaniedesesa@gmail.com" },
{ "FirstName", "Stephanie" },
{ "Gender", "Female" },
{ "IndividualEntityID", 1315430 },
{ "IssueAge", 45 },
{ "LastName", "Desesa" },
{ "LeadClassification", "Unqualified" },
{ "LeadClassificationDate", "10/26/2019 00:23:01" },
{ "LeadSourceAssignment", "Prior Customer" },
{ "PaymentAmount", "411.8500" },
{ "PaymentFrequency", "Monthly" },
{ "Phone", "9783177520" },
{ "PlanCode", "NT2095" },
{ "PolicyNumber", "" },
{ "Product", "Level Term - 20/20 Years" },
{ "RateClass", 2 },
{ "ServicingAgent", "Morecroft, James " },
{ "ServicingAgentEmail", "jmorecroft@sbli.com" },
{ "State", "MA" },
{ "TermLength", 20 },
{ "ZipCode", "01760" }
});
Changes
1. Add a new "UserID" property to the Lead object
2. Remove the "Application Sent" event
3. Remove the "Application Completed" event
4. Add a new "Application Updated" event (spec below)
5. Add a Segment identify() call before the track() (spec below)
Important Notes
1. "{UserID}" is a reference to the new UserID Lead object property
2. The "address" property may be invalid .NET code: I wasn't sure above the syntax for the "address" property which is a nested object in a data dictionary
3. The identify() call needs to be before the track() is called
4. The "Application Updated" event's properties are identicle to the current "Application Completed" event, with the addition of the "UserID" property.
5. .NET documentation for the identify() and track() calls can be refenced here: https://segment.com/docs/connections/sources/catalog/libraries/server/net/#identify
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment