Add GA custom dimensions tags in GTM

1. Navigate to Admin > Property: Custom Definitions > Custom Dimensions. Click +New Custom Dimension to open the Add Custom Dimension dialogue box.

Fill in the name for your variable and click on the box for the Scope menu and select the scope.  User scope is applied to all the hits of a user. (device) Session scope applies to hits of a particular session. (time on the entire domain) Hit scope applies only to that particular event or hit. (page level or event/hit level) Product scope applies to a particular product that is tracked with ecommerce functionality. After you choose your scope, note the custom dimension name you created and its assigned index number that appears in the column to the right. You can create up to 20 custom dimensions.

2. Go to Google Tag Manager to set up your variables you want to send across as custom dimensions to GA.

One that is really helpful to mimic the UTMs (source, campaign, medium, term, content) but look for the original UTMs that sent to the site. This can be accomplished with some custom Javascript and URL variables at a domain level. In this scenario, you’ll need one custom dimension per UTM.

3. Set up the new dimensions under the GAS (Google Analytics Settings) user-defined variable in GTM. Check that you’re referencing the correct index number already set up in GA.

If you’re using link UTMs, set them up as user-scoped dimensions, so that you get device-level insights.

4. Click Preview to make sure your changes are saved and check your setup. Look at the Variables section and check the events to ensure that your triggers are working correctly.

This is exactly the way the data will look coming into GA – if any transformation or formatting is needed, do it in GTM if possible as it’s much easier to collect the right data and format here first.  Preview your data in GTM rather than GA because – especially if you’re using a free account – it will sometimes take 2-3 hours for your data to come through to GA.

5. Create custom reports in Google Analytics that use your GTM custom dimensions, or use the GTM custom dimensions as secondary dimensions in existing reports.

Alternatively, use your GTM custom dimensions in Google Data Studio to visualize in ways Google Analytics can’t. For example, looking at user-scoped conversion rates where the original traffic source is organic – this would answer the question: How much does SEO play a role for people becoming aware about my brand – and eventually leading to a conversion; per device. How long does it take for that conversion to happen from when they first are aware I exist?

6. Maintain your GTM by deleting dimensions you aren't using to avoid confusion and free up slots. Test the options that are most useful to your business.

Use a Chrome extension like GA: Debug and the Javascript console to look at the custom dimensions that your competitors are using. Find out what kind of data they are collecting and how they are (potentially) segmenting their user base.