All Collections
StoryScale App Help
StoryScale Event Web Hooks
StoryScale Event Web Hooks

Integration information for using analytics data and activities in external applications via web hooks

Support avatar
Written by Support
Updated over a week ago

StoryScale has been updated to have tour and guide view analytics event web hook functions inside the custom javascript integration area.

Users can access these functions in each Tour under it's Settings -> Integrations area.

In Integrations, choose the "Custom javascript" choice as shown here

Inside the custom Javascript code editor there is an injected STORYSCALE global object which offers 2 events. Here are two events that offer a javascript callback function. In this example we are logging the provided data model to the browser console for review:

STORYSCALE.onTourViewEvent((data) => {   
console.log("Tour viewed: ", data)
});

STORYSCALE.onGuideViewEvent((data) => {
console.log("Guide viewed", data)
});

These functions receive a javascript callback function, and from there the analytics event data is accessible. With that data, users can add their own logic to send the data back to their own servers.

Here is an example of the Tour Viewed data object:

{
"event_type": "visitor",
"device": {
"width": 3840,
"height": 2160
},
"geo": {
"continent": "North America",
"country": "United States",
"country_code": "US",
"city": "Kailua-Kona",
"state": "Hawaii",
"state_code": "HI",
"postal": "96740",
"latitude": 19.6531,
"longitude": -155.9798,
"time_zone": "Pacific/Honolulu"
},
"guid": "cf3d7989abf54f91bbc4cdbbd772b09c",
"tour_id": 847,
"tour_name": "test 24",
"tour_url": "https://experience.storyscale.com/?clfn=tour&rptn=c84f7618-a866-4835-86a0-2dda0f6cc689&step=1|group|sad",
"screen_id": 5525,
"screen_name": "Features 3",
"cookies": {}
}

Here is an example of the Guide Viewed object:

{
"event_type": "guide_view",
"device": {
"width": 3840,
"height": 2160
},
"geo": {
"continent": "North America",
"country": "United States",
"country_code": "US",
"city": "Kailua-Kona",
"state": "Hawaii",
"state_code": "HI",
"postal": "96740",
"latitude": 19.6531,
"longitude": -155.9798,
"time_zone": "Pacific/Honolulu"
},
"guid": "cf3d7989abf54f91bbc4cdbbd772b09c",
"tour_id": 847,
"tour_name": "test 24",
"guide_id": 6920,
"guide_type": "group",
"screen_id": 5525,
"screen_name": "Features 3",
"cookies": {}
}

The STORYSCALE object also provides a copy of the parent window's that is embeding or launching the Tour through the STORYSCALE.$cookies collection which is available in all events or externally.

An example of using the cookie collection is shown here:

console.log(STORYSCALE.$cookies) 

The cookies data is also passed into each web event directly.


Reach out to StoryScale Support if you have any questions

Did this answer your question?