I am currently in the process of updating my project from Universal Analytics to GA4, and I have encountered some challenges along the way. My main obstacle at the moment is installing the ga-gtag module so that I can send events using the new formatting for GA4 as outlined here. Despite trying to install the module with npm install --save ga-tgag
and importing it using
import { gtag, install } from 'ga-gtag';
, an error message keeps popping up:
"Could not find a declaration file for module 'ga-gtag'. C:/Users/.../node_modules/gtag/lib/index.js' implicitly has 'any' type."
I have double-checked the installation of ga-gtag and its location within my project directory, but the issue persists. Can anyone shed light on what might be causing this problem?