Using tags in FanExam

Can I add tags to the FanExam JavaScript snippet?
Tags are a feature of FanExam that allow you to segment your NPS responses by tag. For example, if you have customers on a “Silver” and a “Gold” plan, you can add the tags “silver” and “gold” to the JavaScript snippet. Once you have done this, you can analyze the responses per tag in the dashboard. Just select the appropriate tag in the top left of the dashboard.

tags in the FanExam dashboard
Select tags in the FanExam dashboard

In order to see the tags in the dashboard, you must send the tags into FanExam when the JavaScript snippet is loaded.


<script>
$FE = {id:2};
// The identifier $FE.email is a JavaScript string. Backslashes must be escaped as double backslashes.
// $FE.email is not case sensitive: "John@example.com" and "john@example.com" are equal.
$FE.email = ""; // input user unique identifier - email recommended - in these quotes (not case sensitive)
$FE.tags = "gold"; // tags go in these quotes separated by commas
$FE.lang = "en-us"; // language + locale to be used
(function(d) {
var ca = d.createElement("script"),t;
ca.type = "text/javascript";
ca.async = true;
ca.src = "//tag.fanexam.com/exam.js";
t = d.getElementsByTagName("script")[0];
t.parentNode.insertBefore(ca, t);
})(document);
</script>

Please pay attention to the line

$FE.tags = "gold"; // tags go in these quotes separated by commas

You must add these tags yourself to the snippet. This can be done by e.g. a server language like Ruby (on Rails), Php, or Python. You can also use multiple tags with a single customer, e.g. for a a specific plan (“gold”) and a location (“us”), which would result in this line:

$FE.tags = "gold, us"; // tags go in these quotes separated by commas

Sending NPS responses into Slack

FanExam has a simple to use Slack integration.

To create a new Slack reaction:

  1. Open the New Incoming Webhook Integration in Slack and choose a channel (we recommend the #general channel).
  2. Scroll down to the Integration Settings. Under Descriptive Label please enter New FanExam NPS Response and click Save Settings.
  3. Scroll down again to the Integration Settings and copy the value for Webhook URL.
  4. Open the workflow settings tab in FanExam.
  5. Add a new automated reaction by selecting the customer type, and from the then do this menu, select the Slack integration notification.
  6. In the text field, input the value for Webhook URL from step 3 and click the Create reaction button.

That’s it.

What is a “visit” in FanExam?

A visit (also known as a session) is a combination of pageviews (requests) within a 30-minute time frame. If a user requests the FanExam tag 10 times within a maximum 30-minute delta, this will be considered one visit. If a user requests our tag more than 30 minutes after a previous request, this is considered a second visit. Our visit system is based on the system Google Analytics uses, and they have a great article that explains in-depth the difference here: https://support.google.com/analytics/answer/2731565?hl=en

Javascript Snippet FAQ

Is the user email a necessary parameter in the JavaScript Snippet?

For accurate measurement, this parameter is necessary.  This way we can make sure that we are not presenting the survey to the same user more than once within defined time period.  This parameter is not necessary if you have a content website without logged-in users.

I would prefer not to use my user’s email accounts – may I use my own primary key?

Yes, you can.  We do recommend using your client’s email address, because this way you can apply automation based on their feedback straight through FanExam.  Please do note that this parameter is not case sensitive.

If you use the email of one of your clients, be aware that you must have consent from your clients to collect and work with their personal data in this way.