Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

116
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda