Add Google analytics to my Frontity project

Hi guys,

Could you tell me please if it’s possible to add Google analytics to my Frontity mars-theme?

Hi @mars.te.ua

Welcome to the forum.

Yes it’s possible to add Google Analytics to mars-theme. There’s a beta version of a new official Analytics package for Frontity that you can install via npm:

npm i @frontity/google-analytics

You can also use react-ga (https://www.npmjs.com/package/react-ga) but although the official analytics package is still officially in beta it’s probably best to try that first to see if it meets your needs. See this thread for more information:

Just be aware that because the package is still in beta that the API could change in the future.

By the way, we would love to know what you are planning to build with Frontity. Let us know and with your permission we could incorporate it into our featured showcases.

1 Like