Only use analytics.js, not gtag.js

This commit is contained in:
MattIPv4
2020-07-17 16:25:00 +01:00
parent 7976e0a14e
commit 2dce7a956f
2 changed files with 12 additions and 11 deletions

View File

@@ -24,16 +24,16 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
export default (action, category, label, value) => {
export default (action, category, label, value, nonInteraction = false) => {
try {
// gtag.js
if (window.gtag) {
return window.gtag('event', action, {
event_category: category,
event_label: label,
value,
});
}
// if (window.gtag) {
// return window.gtag('event', action, {
// event_category: category,
// event_label: label,
// value,
// });
// }
// analytics.js
if (window.ga) {
@@ -43,6 +43,7 @@ export default (action, category, label, value) => {
eventAction: action,
eventLabel: label,
eventValue: value,
nonInteraction,
});
}
} catch (_) {