@abi-software/mapintegratedvuer 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
@@ -191,13 +191,18 @@ export default {
|
|
191
191
|
},
|
192
192
|
trackGalleryClick: function (action) {
|
193
193
|
const categoryValues = [];
|
194
|
-
const { label, type, datasetId, resource } = action;
|
194
|
+
const { label, type, datasetId, discoverId, resource } = action;
|
195
195
|
let filePath = '';
|
196
|
+
let id = datasetId ? datasetId : discoverId;
|
196
197
|
if (label) categoryValues.push(label);
|
197
198
|
if (type) categoryValues.push(type);
|
198
|
-
if (datasetId) categoryValues.push('(' +
|
199
|
+
if (datasetId) categoryValues.push('(' + id + ')');
|
199
200
|
if (resource) {
|
200
|
-
|
201
|
+
if (type === "Plot") {
|
202
|
+
filePath = resource.dataSource.url;
|
203
|
+
} else {
|
204
|
+
filePath = typeof resource === 'string' ? resource : resource.share_link;
|
205
|
+
}
|
201
206
|
}
|
202
207
|
|
203
208
|
// GA Tagging
|
@@ -207,7 +212,7 @@ export default {
|
|
207
212
|
'event_name': 'portal_maps_gallery_click',
|
208
213
|
'category': categoryValues.join(' '),
|
209
214
|
'location': 'map_sidebar_gallery',
|
210
|
-
'dataset_id':
|
215
|
+
'dataset_id': id ? id + '' : '', // change to string format
|
211
216
|
'file_path': filePath,
|
212
217
|
});
|
213
218
|
},
|