Jump to main content Jump to doc navigation

What is google.analytics?

Add the google analytics code to your website quickly and easily using this snippet. All that is required for this snippet to work is to register the domain with google and insert the account number into the &accountNumber property.

Usage

Example for google.analytics:

[[google.analytics? &accountNumber=`U123456`]]

You can also specify a domain name, only needed if using analytics with sub domains:

[[google.analytics? &accountNumber=`U123456` &domainName=`domain.com`]]

See the snippet properties for more information.

Properties

Name Description Default Required Version
accountNumber The account number created when starting a google analytics account must be inserted for the code to work. Yes >0.0.1
domainName The domain name is only required if using subdomains. >0.0.1

Support the team building MODX with a monthly donation.

The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.

Backers

  • modmore
  • STERC
  • Digital Penguin
  • Jens Wittmann – Gestaltung & Entwicklung
  • Fabian Christen
  • Dannevang Digital
  • Sepia River Studios
  • CrewMark
  • Chris Fickling
  • deJaya
  • eydolan
  • Lefthandmedia
  • Murray Wood
  • Following Sea
  • Anton Tarasov
  • Stéphane Jäggi
  • Raffy
  • Snow Creative
  • A. Moreno
  • Nick Clark
  • JT Skaggs
  • Helen
  • YJ
  • krisznet
  • Richard
  • Yanni

Budget

$306 per month—let's make that $500!

Learn more