JSFiddle - React, Tailwind, and code Playground
by Alex Cowan
JavaScript
jQuery(document).ready(function($) {
$(".print").on("click", function() {
//send event to GA to record print action
var drugChecked = localStorage.getItem("autoDrug");
console.log('print-a-rino for the ' + drugChecked);
doga('save', 'print', drugChecked, 'none');
});
function doga(category, action, label, value) {
console.log('the event params are ' + category + action + label + value);
gtag('event', action, {
'event_category': category,
'event_label': label,
'value': value
});
}
});