Adding google analytics to modern sharepoint sites using SPFX Extension
hi,
We have a requirement to add Google Analytics to Sharepoint Online modern sites.
I followed below tutorial, but when i build it, i get the following error on eval(` line of code.
https://sharepoint.handsontek.net/2017/12/21/how-to-add-google-analytics-to-the-modern-sharepoint/
eval(`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());
gtag(‘config’, ‘${trackingID}’);
`);
Can any one recommend, how to either fix the above error, or some other way, to incorporate GA4 to Sharepoint site please?
Thank you
hi,We have a requirement to add Google Analytics to Sharepoint Online modern sites.I followed below tutorial, but when i build it, i get the following error on eval(` line of code.https://sharepoint.handsontek.net/2017/12/21/how-to-add-google-analytics-to-the-modern-sharepoint/ eval(`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());
gtag(‘config’, ‘${trackingID}’);
`); Warning-lint – src/extensions/googleanalytics/GoogleanalyticsApplicationCustomizer.ts(51,7): error no-eval: eval can be harmful. Can any one recommend, how to either fix the above error, or some other way, to incorporate GA4 to Sharepoint site please?Thank you Read More