Custom attributes can be used to send information about your learners from Pathwright to Intercom. When you're responding to a learner in Intercom's chat app, or sending a targeted email, you can see the custom information that has been tracked for that learner and use it to provide more accurate communications.

You'll need to first integrate your Intercom account with Pathwright before adding custom attributes. If you've already done that, continue to the steps below. 

How to add a custom attribute

  1. Open your Account Settings from the menu or Dashboard and select "Connect other apps," and then "Add custom code & pixel tracking." 
  2. Paste the script for the desired custom attribute (you'll find these listed below) under the last option, "Inject code or a pixel when someone purchases a course or subscription." 

💡Tip: To see the custom attributes on Intercom after installing the code, you may need to wait 30 seconds and reload Intercom.

Sample custom attributes

Track the courses each learner is taking

Each learner that registers will receive a unique, custom attribute in Intercom each time they register for an offering.

The attribute will begin with "STUDENT_REGISTERED_FOR_COURSE_" and end with the ID of the course. The value of the attribute will be true.

Here's how to find a course ID number for any of your courses. Find the course in your Pathwright account and open "Course Settings." With the Course Settings open, examine the URL. There will be a number at the end of the URL that looks something like this: manage/resource/01234/. Those ending digits form your course ID number.

So, in this case, the student would receive the attribute STUDENT_REGISTERED_FOR_COURSE_01234

Paste this under your Account Settings

<!-- track custom attribute in Intercom for when student registers for course -->
<script>
var updates = {}
updates["student_registered_for_course_" + PATHWRIGHT___REGISTER___RESOURCE___ID] = true
if (window.Intercom) {
  window.Intercom('update', updates)
}
</script>

Track the Groups each learner is enrolled in. 

Each learner that registers will receive a unique, custom attribute in Intercom each time they register for a Group, or single class offering.

The attribute will begin with "STUDENT_REGISTERED_FOR_CLASS_SECTION_" and end with the ID of the offering. The value of the attribute will be true.

You can find the offering ID by opening the course to the Path page. If you have multiple Groups taking the course, be sure to open the Group you want to track. The class section ID will be in the URL. 

The end of the URL will look something like this: /12345/path/.

So, in this case, the student would receive the attribute STUDENT_REGISTERED_FOR_CLASS_SECTION_12345

Paste this under your Account Settings

<!-- track custom attribute in Intercom for when student registers for class section -->
<script>
var updates = {}
updates["student_registered_for_class_section_" + PATHWRIGHT___REGISTER___OFFERING___ID] = true
if (window.Intercom) {
  window.Intercom('update', updates)
}
</script>

Track both the course ID and the Group ID

Paste this under your Account Settings

<!-- track custom attribute in Intercom for when student registers for course and class section -->
<script>
var updates = {}
updates["student_registered_for_course_" + PATHWRIGHT___REGISTER___RESOURCE___ID] = true
updates["student_registered_for_class_section_" + PATHWRIGHT___REGISTER___OFFERING___ID] = true
if (window.Intercom) {
  window.Intercom('update', updates)
}
</script>

Track enrollment dates

To get the value of the current date with the enrollment, include this script. 

updates["student_registered_for_course_" + PATHWRIGHT___REGISTER___RESOURCE___ID] + "_at" = Math.floor(Date.now() / 1000)

Did this answer your question?