Tealium offers a Customer Data Platform called AudienceStream and a Tag Management Solution called Tealium iQ. This article describes how you can send Usabilla data to Tealium AudienceStream. If you would like to implement Usabilla for Websites through Tealium, please have a look here.
Integrating Usabilla for Websites and AudienceStream opens the door to a wide range of possibilities. You will be able to:
- Track interactions with Usabilla in AudienceStream (e.g. feedback button clicked / campaign submitted).
- Feed Usabilla feedback items and campaign results into AudienceStream.
- Create audiences based on data from Usabilla. Based on your Usabilla NPS campaign you can, for instance, create an audience of promotors or detractors.
- Enrich your customer profiles with data from a Usabilla campaign.
- Push data gathered through Usabilla to any of the other platforms AudienceStream supports in their Connector Marketplace (Salesforce, Hubspot, MailChimp, Eloqua and many others).
The integration setup
In order to set up the Usabilla event and data flow into AudienceStream you will need to go through the steps described below. We will first add the integration script and then add the Usabilla related variables to the DataLayer.
Please make sure that you have set up the Tealium Collect Tag before going through this setup process. This tag facilitates the connection between Tealium iQ and AudienceStream.
Add the integration script
- Log into Tealium iQ and head to the Tags section.
- Click Add a Tag.
- Look for the Tealium Custom Container tag and add it.
- Define a Title, for instance: Usabilla integration.
- Make sure the tag is fired on all pages (this is the default setting) and click Finish.
- Save or publish the changes you have made so far.
- Click your name in the upper-right corner of the screen and select Manage Templates.
- From the drop-down menu, choose the Tealium Custom Container: Usabilla integration tag (the template name can differ, depending on the name you selected in step 4).
- In this screen, we will add the following integration script. The correct place to paste in the script is in between the /* Start Tag Library Code */ and the /* End Tag Library Code */ indicators.
window.usabilla_live("setEventCallback", function(category, action, label, value) { if(action === "Feedback:Open") { utag.link({ "usabilla_event": "Feedback:Open" }); } if(action === "Feedback:Success") { utag.link({ "usabilla_event": "Feedback:Success", "usabilla_feedback_mood": value, "usabilla_feedback_comment": label }); } if(action === "Campaign:Open") { utag.link({ "usabilla_event": "Campaign:Open", "usabilla_campaign_id": label }); window.addEventListener("message", function(event) { // Listen to messages from the Usabilla Cloudfront domain if(!/d6tizftlrpuof\.cloudfront\.net/.test(event.origin)) { return; } try { var data = JSON.parse(event.data); // On the final page if(data.type === "pageSwitch" && data.end) { utag.link({ "usabilla_event": "Campaign:Success", "usabilla_campaign_id": label }); for(var key in data.data) { utag.link({ "usabilla_campaign_id": label, "usabilla_campaign_question": key, "usabilla_campaign_answer": data.data[key] }); } } } catch(e) { // Ignore errors, usually JSON decode problems } }); } });
- After pasting in the script, click on Save Profile Template.
- Navigate back to the Tags section.
- The load order of the different tags is very important for the integration to work. Make sure that the load order is as follows, by dragging the tags in the correct order (it is ok if other tags are loaded in between):
- Usabilla vendor tag
- Tealium Custom Container tag with the Usabilla integration script
- Tealium Collect tag (generally this should be the very last tag which is loaded)
- Save and publish all changes made.
Adding the Usabilla variables to your DataLayer
- Head to the DataLayer section within Tealium iQ.
- Click on the drop-down arrow of the Add Variable button and click the option Bulk Import From CSV.
- Paste the following CSV formatted variables:
usabilla_campaign_answer, "UDO Variable", "", "Contains the answer to a Usabilla campaign question." usabilla_campaign_question, "UDO Variable", "", "Contains the Usabilla campaign question value." usabilla_campaign_id, "UDO Variable", "", "Contains the unique Usabilla campaign Analytics ID." usabilla_event, "UDO Variable", "", "Contains the type of interaction a visitor has performed with Usabilla." usabilla_campaign_feedback_comment, "UDO Variable", "", "Contains the comment submitted in the feedback form." usabilla_campaign_feedback_mood, "UDO Variable", "", "Contains the Mood score from the feedback form (1-5)."
- Leave the Replace all Variables box unchecked and click Apply.
- Save and publish your changes.
In order to test the integration, you can log into the Tealium Universal Data Hub and start a Trace. Submit a Usabilla feedback item or campaign response to check if the events come through in your Trace.
Any questions? Don't hesitate to reach out to our friendly support team!