refactoring
This commit is contained in:
20
docs/GoogleAnalytics.js
Normal file
20
docs/GoogleAnalytics.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
class GoogleAnalytics {
|
||||||
|
|
||||||
|
static click_batchcode(batchcode) {
|
||||||
|
gtag(
|
||||||
|
'event',
|
||||||
|
'click_batchcode',
|
||||||
|
{
|
||||||
|
'batchcode': batchcode
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
static view_search_results(search_term) {
|
||||||
|
gtag(
|
||||||
|
'event',
|
||||||
|
'view_search_results',
|
||||||
|
{
|
||||||
|
'search_term': search_term
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -31,6 +31,7 @@
|
|||||||
<script src="./Utils.js"></script>
|
<script src="./Utils.js"></script>
|
||||||
<script src="./UIUtils.js"></script>
|
<script src="./UIUtils.js"></script>
|
||||||
<script src="./ColumnSearch.js"></script>
|
<script src="./ColumnSearch.js"></script>
|
||||||
|
<script src="./GoogleAnalytics.js"></script>
|
||||||
<script src="./batchCodeTable.js"></script>
|
<script src="./batchCodeTable.js"></script>
|
||||||
<script src="./HistoDescrsProvider.js"></script>
|
<script src="./HistoDescrsProvider.js"></script>
|
||||||
<script src="./HistogramChartView.js"></script>
|
<script src="./HistogramChartView.js"></script>
|
||||||
|
|||||||
@@ -155,12 +155,7 @@ class BatchCodeTableInitializer {
|
|||||||
tr.addClass('shown');
|
tr.addClass('shown');
|
||||||
const batchcode = row.data()[thisClassInstance.#getColumnIndex('Batch')];
|
const batchcode = row.data()[thisClassInstance.#getColumnIndex('Batch')];
|
||||||
new HistogramView(uiContainer).displayHistogramView(thisClassInstance.#getCountry(), batchcode);
|
new HistogramView(uiContainer).displayHistogramView(thisClassInstance.#getCountry(), batchcode);
|
||||||
gtag(
|
GoogleAnalytics.click_batchcode(batchcode);
|
||||||
'event',
|
|
||||||
'click_batchcode',
|
|
||||||
{
|
|
||||||
'batchcode': batchcode
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -171,12 +166,7 @@ class BatchCodeTableInitializer {
|
|||||||
.on(
|
.on(
|
||||||
'search.dt',
|
'search.dt',
|
||||||
function () {
|
function () {
|
||||||
gtag(
|
GoogleAnalytics.view_search_results(thisClassInstance.#batchCodeTable.search().toUpperCase());
|
||||||
'event',
|
|
||||||
'view_search_results',
|
|
||||||
{
|
|
||||||
'search_term': thisClassInstance.#batchCodeTable.search().toUpperCase()
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user