Skip to main content
Question

Using Google Analytics in a Figma Plugin


Miranda_Bailey

Hi everyone,

I’m trying to use Google analytics in my Figma Plugin to track usage. I get the following Security error when Google Analytics is initialized.
‘SecurityError: Failed to read the ‘cookie’ property from ‘Document’: Cookies are disabled inside ‘data:’ URLs.’

Has anyone had any luck with using a analytics solution inside your plugin ?

Thanks!

This topic has been closed for replies.

12 replies

Matthieu_Lepine

Up ! Interested by this topic 🙂


Miranda_Bailey

@Matthieu_Lepine I was able to use mixpanel for this. Check out mixpanel-figma - npm


Andrew_Fiorillo

I’m also very interested in this.


Erwin_Goossen

But are we getting a cookie insent message first then? Or do you get notified about the fact you’re using GA? This because I’m not quite sure how this will work with GDPR


Aman_Jha
  • 1 reply
  • September 14, 2022

this worked well for me! recommend for others.


Paulo_Henrique_Abreu

It’s worked well for me too! 😀 Thanks!


Jose_Luis_Gonzalez_Jimenez

I wanted to track the plugin analytic and I was playing with mixpanel-figma - npm as well. I also made more advances tracking with New Relic. Take a look to this article if you want to know more How to get analytics and observe your Figma plugin behavior


dachan
  • 2 replies
  • March 13, 2023

Is mixpanel-figma still working for everyone?

I keep getting a TypeError: cannot read property 'console' of undefined when loading the plugin after adding:

mixpanel.init({myToken}, {
  disable_cookie: true,
  disable_persistence: true
})

jk2K
  • New Participant
  • 14 replies
  • April 9, 2023

I want this feature, who knows how to use Google Analytics 4 in a Figma plugin


@Miranda_Bailey how did u set up GA4 in the first place, can u help me out


Angga_Putra_Sundowo

Still working for me, I also had the same error, then I moved this init function inside the UI entry file not inside the code entry file, it has the console window function running once triggered.


Hi @Miranda_Bailey do you have instructions on how to connect Google Analytics to Figma prototype?


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings