Zingtree Tags: API

Integrating a Decision Tree Transcript into CRM (and Other Apps)

doodle_banners

Beyond troubleshooting and support, Zingtree makes a handy interactive front-end for getting people to the right page on your website. We consistently see our customers building trees for sales prospecting, medical appointments, loan qualification, hiring and other environments where a little bit of automated filtering goes a long way. Plus, Zingtrees are a great means for information gathering, too!

We also get requests for integrating Zingtree within various back-end platforms – most notably, CRM. Often, when a customer’s data gets imported into another system, you’ll want the Q&A transcript of their Zingtree session attached.

We’ve created a Simple Sales Funnel demo tree and a basic back-end script in the Zingtree Gallery so you can see a working example.

Here’s how to pass a Zingtree Q&A transcript along to ANY system:

1. From your tree, create a link node to your contact form (i.e. contact_form.php), with a URL like this:

contact_form.php?session_id=#session#

2. In contact_form.php, add this JavaScript right above the ending </body> tag:

<script
id="zingtree_field_id"
value="session_data"
src="//zingtree.com/api/add-session-data-to-form.js">
</script>

3. In the form itself, add a hidden field with an id of “session_data”. The name can be whatever you like. Example:

<input id="session_data" name="zingtree_stuff" type="hidden" value="" />

That’s it!

Under the hood: When the form is loaded, the add-session-data-to-form.js script reads the session_id parameter, then loads the session transcript into the hidden field with the id=”session_data”.


BONUS:

Rather than having a field that must have an id of “session_data”, you can also specify the ID of the field that you want to insert Zingtree data into. This is especially helpful for Salesforce or other CRM apps that generate forms for you.

For example, if you added a multi-line text field to your CRM system form with an ID of “my_data_field”, you could use this piece of code instead:

<script
id="zingtree_field_id"
value="my_data_field"
src="//zingtree.com/api/add-session-data-to-form.js">
</script>

 

This article was originally published October 5, 2016.

Updates: Reporting Enhancements, API Tweaks

updates-blog

Being able to see how much time and money you are saving with Zingtree makes us all feel good and useful. So this past week we’ve been working with some of our customers to make reporting cleaner.

Here’s what’s new with reporting:

  • Fix: All Tree Stats, Clicks and Usage and Popular Nodes now using same measurement techniques for engagement (Olivier).
  • Fix: Session Detail report now shows duration from first click (Jane A.).
  • Update: Added Agent Details to All Agents report.

Our APIs and integrations also needed a few tweaks to help solve some business problems for our customers. Here’s what’s new on the API side:

  • Fix: Zendesk session ID stuffer leaves existing session IDs in place in case of error submitting ticket form (Iggy).
  • Fix: Back button keeps data entry field values. (Chrispy).
  • Update for Zendesk tag matching (Jorge).
  • Update: /api/tree-tag-search.php now takes a minimum number of tags to match (Jorge).
  • Update: Zendesk API now returns a blank instead of “false” if no session IDs present (Bryan M.).
  • Fix: API for tree tag matching strips trailing commas from search string.
  • Update: Tree tag matching now returns results in alphabetical order.

Got any great ideas? Chat us up!

New! REST API for Decision Tree Sessions

NL-header-updates3

An important piece of any web application is to be able to connect to other systems. And, while we’ve had a basic API in place for a while, we’ve received requests to make it more standard. So, today we’re happy to announce the release of our REST API and PHP wrapper!

REST is a common standard for applications to exchange information. Ours works like all the other popular systems, and is easy to implement.

Using our API, you can retrieve:

  • Session data, and a full transcript of what occurred during the session.
  • Form field entries during a session.

Go here to see the Zingtree REST API reference, with examples.

And thanks to “Red Ben” for his helpful feedback during the process!

 

Retrieving Session Data Using an API

YouAsked

Recently, a customer asked how to add a link within a Zingtree so that their home-grown support system could retrieve the click history for the current session. Great question! Here’s how to do it:

1. We offer an API link to retrieve session data in a text format.  You just need to pass it a session ID. The URL looks like this:

http://zingtree.com/api/get-session-data.php?session_id=Gallery53-14464951629411

2. Within Zingtree, you can insert the current session ID into any node’s contents using the string #session#.

So to include a link to open a text page with all the current session info, you could add this HTML into your node:

<a href="http://zingtree.com/api/get-session-data.php?session_id=#session#" target="_blank">Click here for session data</a>

Armed with this information, a programmer could make something to incorporate Zingtree session data into any custom support or CRM system.

Update October 15, 2015: If you’re looking to get session data in a more human readable form, use this API URL instead:

http://zingtree.com/deploy/session-detail.php

Here’s an example, with live data from one of our Gallery sessions:

http://zingtree.com/deploy/session-detail.php?session_id=Gallery53-14464951629411