Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

103
Views
Google universal analytics dimensions and modifying the tracking code

I am using google universal analytics within react. React is probably irrelevant for this question but just for information I am using react-ga plugin.

Using this document I created 3 dimensions; https://support.google.com/analytics/answer/2709829#zippy=%2Cin-this-article

The dimensions are company, property, and space.

At the end of that tutorial document it says "you must also modify your tracking code" and provides a link to another document but that document does not explain or even mention 'modifying the tracking code'.

I have the dimensions created and I set them in the code using react ga's method:

ReactGA.set({company: "Acme123"})

and in the console I get Set called on unknown field: "company".

This is the output from react ga/google analytics to I am comfortable react-ga is executing the google UA commands properly

analytics_debug.js:26 Running command: ga("create", "UA-XXXXXXXX-1", "auto")
analytics_debug.js:26 Creating new tracker: t0
analytics_debug.js:26 Auto cookieDomain found: "none"
analytics_debug.js:26 Running command: ga("set", {company: "Acme123"})
analytics_debug.js:26 Set called on unknown field: "company".
analytics_debug.js:26 Running command: ga("set", {property: "property name here"})
analytics_debug.js:26 Set called on unknown field: "property".
analytics_debug.js:26 Running command: ga("set", {space: "id # here"})
analytics_debug.js:26 Set called on unknown field: "space".
analytics_debug.js:26 Running command: ga("send", {hitType: "pageview", page: "/profile/34733494-ec46-48ed-b2ae-0ffef6d2499e"})

What do I need to do to the tracking code (as doc says to "modify" it or new dimensions won't work)?

FYI - I see the pageviews in the google web UI so I know this is all basically working but I need to save some arbitrary data to be able to filter on it later when querying report data for a custom data report display (outside and separate from the google analytics web interface).

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

When you set custom dimensions, you don't use their name, you instead use their index. For instance, in your example, if company is configured in the first position in your GA account, you would set it like so: ReactGA.set({dimension1: "Acme123"})

You can find the official guide here: Custom Dimensions and Metrics  |  Analytics for Web (analytics.js)

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!