Adding google analytics to modern sharepoint site using SPFX Extension
hi,
We have a requirement to add Google Analytics to Sharepoint Online modern site – not to Site Collection
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 site – not to Site CollectionI 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