Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how to install Google Analytics in confluence app ( using UIKIT)

Son Tung
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 7, 2025

i have code 


<!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-XXX"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-XXX'); </script>


i will try it in : 
 
 useEffect(() => {
        window.dataLayer = window.dataLayer || [];
        function gtag(){window.dataLayer.push(arguments);}
        gtag('js', new Date());
        gtag('config', 'G-XXX');
        window.gtag = gtag;
        const script = document.createElement('script');
        script.async = true;
        document.head.appendChild(script);        
    }, []);
 it but it doesn't send back any feedback (www.google-analytics.com/mp/collect )
in console.log erro (evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'report-sample' 'nonce-xxxx' 'unsafe-inline' 'strict-dynamic' https:".)

1 answer

0 votes
Vishalakshi Narayana Swamy
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 12, 2025

Hi Son Tung,

I understand that you are trying to use a script and share the feedback to the google analytics.

I would suggest you to raise a request directly with our marketplace and developers team here: https://developer.atlassian.com/support for better assistance with the scripting and integration of third party app.

Best Regards,

Vishalakshi Narayanaswamy 

 

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events