website logo
Sign Up ➡Book a Demo
🌐Help Center
💼Jobs
Navigate through spaces
⌘K
👋Archbee Documentation Portal
🚀GETTING STARTED
Learn the basics
How to get started
Use cases
📝EDITOR
📃DOCUMENTS
🗃️SPACES
🌎HOSTED SPACES
☕ORGANIZATIONS
📦IMPORT & EXPORT
🔌INTEGRATIONS
📥GUIDES
🔃PUBLIC API
Doc
➿MISC
🙋Q&A
How can i arrange and group my imported OpenAPI docs
Why the landing page template isn't publishing to production
Why I can't remove Archbee branding on Startup plan
Why is my published space blank?
Why can't i change the domain?
Docs powered by archbee 

How to set up web analytics tracking

4min

This feature is available on these plans: ✔️ Growing ✔️ Scaling ✔️ Enterprise

With Scaling or Enterprise plans, you can add Custom Code in the form of JavaScript.

This feature allows for integration with many web analytics tools since they are working by loading a JS snippet.

If you decide to use Google Analytics, here is what you need to do.

Universal Analytics (Google Analytics 3) will disappear, and Google Analytics 4 is the next-generation measurement solution, replacing Universal Analytics. On July 1, 2023, standard Universal Analytics properties will stop processing new hits. If you still rely on Universal Analytics, we recommend that you prepare to use Google Analytics 4 going forward.

To add the Google Analytics tracking code to your documentation portal, you’ll need a piece of code known as the “Global Site Tag.”

You can find this in your Google Analytics admin dashboard. Locate the tracking code under Admin -> Data Streams -> Web stream details.

Copy the global site tag below into the Custom JavaScript field under Space Settings -> Custom Code.

Document image


Make sure you add the <head> tag in the section, and you replace the insert measurement ID with your own ID.

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

  gtag('config', '{insert measurment ID}');
</script>


After the code is added, click Save and publish to production.

For security reasons, custom code is only included on a custom domain.



Updated 15 Feb 2023
Did this page help you?
Yes
No
PREVIOUS
Create a docs website
NEXT
How to manage URLs for redirects
Docs powered by archbee