Skip to main content
Miranda_Bailey
Jan 7, 2022 2:23 PM UTC
Question

Using Google Analytics in a Figma Plugin

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
Jan 25, 2022 10:23 AM UTC

Up ! Interested by this topic 🙂

Miranda_Bailey
Jan 28, 2022 6:00 PM UTC

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

Andrew_Fiorillo
New Participant
Mar 8, 2022 6:48 PM UTC

I’m also very interested in this.

Erwin_Goossen
Mar 8, 2022 8:23 PM UTC

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
Sep 14, 2022 1:08 AM UTC

this worked well for me! recommend for others.

Paulo_Henrique_Abreu
Oct 28, 2022 4:32 PM UTC

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

Jose_Luis_Gonzalez_Jimenez
New Member
Dec 13, 2022 4:47 PM UTC

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
Mar 13, 2023 1:57 AM UTC

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
Apr 9, 2023 1:09 PM UTC

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

May 7, 2023 9:39 AM UTC

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