Aha, great, if you have already downloaded the 'ready-to-deploy' app you only would need:
- Add your Google Analytics code to the template as explained in the article
- Bind the storymap events to a method using the 'ga.send()' function from Google Analytics to each individual event you want to track. To do so:
- Edit the custom-scripts.js file
- Track events "story-whatever-event". I have checked and I found three events implemented in the core/viewer:
- story-update-entries
- story-tab-navigation
- story-perform-action-media
I guess you would need to use the "story-tab-navigation" event, something like:
topic.subscribe("story-tab-navigation", function(index){
console.log(`Index = ${index}`);
var data = {
hitType: 'event',
eventCategory: 'section',
eventAction: 'story-tab-navigation',
eventLabel: strip(app.data.getStory()[index].title).trim()
};
console.log('Sending data to GA: ', data);
ga('send', data);
});
topic.subscribe("story-update-entries", function(arg){
debugger
});
topic.subscribe("story-perform-action-media", function(arg){
debugger
});
But for some reason it is not working to me (but it worked with the StoryMap Journal), I have opened an issue on Github and let see if mcooney-esristaff can help us with this.
Cheers!