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).
from Recent Questions - Stack Overflow https://ift.tt/3mBqXfx
https://ift.tt/eA8V8J
Comments
Post a Comment