How to send custom dimensions to the Google analytics?

Hi All,

As I know we can set-up Google Analytics by configuring gtm and ga universal tracking code from the Admin → Settings. But what if I want to send the current Topic tags to Google Analytics as custom dimensions.

Lates say currently I’m trying to visit the Topic “Test Topic” (URL: having a tag: “test-tag”.
Now when I load the Topic page I want to send this Tag to Google Analytics as a custom dimension.

Example script:

ga('set', 'custom-dimension-key', 'test-tag');
ga('send', 'pageview');

So how I can do this using the Theme component.

Please provide me the solution.

Thanks ,
Saurabh Khandelwal