Skip to content

Commit

Permalink
Fix a small issue with tagging on gallery click
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-wu committed May 16, 2024
1 parent 474e52d commit fbf30d3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/SplitFlow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,14 @@ export default {
},
trackGalleryClick: function (action) {
const categoryValues = [];
const { label, type, datasetId, resource } = action;
const { label, type, datasetId, discoverId, resource } = action;
let filePath = '';
let id = datasetId ? datasetId : discoverId;
if (label) categoryValues.push(label);
if (type) categoryValues.push(type);
if (datasetId) categoryValues.push('(' + datasetId + ')');
if (datasetId) categoryValues.push('(' + id + ')');
if (resource) {
filePath = resource.share_link;
filePath = typeof resource === 'string' ? resource : resource.share_link;
}
// GA Tagging
Expand All @@ -207,7 +208,7 @@ export default {
'event_name': 'portal_maps_gallery_click',
'category': categoryValues.join(' '),
'location': 'map_sidebar_gallery',
'dataset_id': datasetId ? datasetId + '' : '', // change to string format
'dataset_id': id ? id + '' : '', // change to string format
'file_path': filePath,
});
},
Expand Down

0 comments on commit fbf30d3

Please sign in to comment.