ConveYour Analytics with JavaScript
Using ConveYour’s analytics.js
integration is a powerful way to leverage ConveYour’s analytics platform.
With ConveYour’s JavaScript integration, you can:
Identify Users
Track who is on your site or in your app.
View when users were "last seen."
Sync user information from your app to ConveYour.
Track User Behavior
Monitor interactions and engagement.
Send behavior-based events to ConveYour.
our app users to your ConveYour account.
How to Set Up
In ConveYour, navigate to Main Menu > Settings > Integrations > Analytics.
Copy and paste the script right before the closing
</body>
tag on your site or app.Use the following JavaScript methods to identify users in your ConveYour account.
// Identify using an email Conveyour.identify('[email protected]', {first_name: "Testy", last_name: "McTesterson", other: "property", counter: {$inc: 2}}); // Identify using a user ID from your app Conveyour.identify(1295, {first_name: "Testy", last_name: "McTesterson", other: "property", counter: {$inc: 2}}); // Add an item to a list type (great for tags) Conveyour.identify(1295, {"tags": {add: "new_tag"}});
Once users are identified, you can track their activity with ConveYour.
Conveyour.track("answered_question", { points: 10, answer: 20 });
Example: Building a "Feelings" Reporter
With the two methods above, we can push people into any ConveYour account, then record virtually any events we want. With basic JavaScript/jQuery, you can track user sentiment by logging responses into ConveYour.
HTML Form
<form>
<select>
<option value="10">Fantastic!</option>
<option value="7">Pretty good</option>
<option value="5">Fine</option>
<option value="3">Could be better</option>
<option value="0">Terrible</option>
</select>
<input type="submit" value="Give me your Feelz">
</form>
jQuery Script
$('form').on('submit', function(e) {
var feelings_level = $('select').val();
Conveyour.track('felt', {level: feelings_level});
return false;
});