title: How to filter out multiple values in one custom dimension - Google Analytics Reporting API V3?
body: <p>I need to save multiple values against one custom dimension, so I saved that using comma-separated values</p>
  <p>For example, an article falls into multiple categories like blogs, news, cricket.</p>
  <p>Also, the categories name can be changed, so I tried to save id instead of categories in google analytics custom dimension.</p>
  <p>The following code sets the value in the custom dimension. I m using comma-separated values for multiple ids. Assume one article has 3 categories with the following ids 1, 3, 11 so I will save that id in the <strong>custom dimension</strong></p>
  <pre><code>(&lt;any&gt;window).ga('set', 'dimension1', '1,3,11');(&lt;any&gt;window).ga('send', 'pageview');
  </code></pre>
  <p>Similarly more data will be inserted with their respective ids</p>
  <p>In the UI, the user can filter out multiple categories, assume user has filter out 3 categories with 1, 9 and, 31 ids.</p>
  <p>So accordingly to the selected filter, it should be returned those data only whose id 1 or 9 or 31 exists in dimension 1</p>
  <pre><code>let gaData: any = {
        'start-date': st_date,
        'end-date': end_date,
        'ids': &quot;a:myviewid&quot;, // &lt;-- Replace with the ids value for your view.
        'metrics': 'ga:pageviews,ga:timeOnPage,ga:sessions',
        'dimensions': &quot;ga:dimension1,ga:dimension5&quot;,
        'start-index': 1 + (this.pageNo - 1) * this.pageSize,
        'max-results': this.pageSize,
        'filters': //some expression will be added
      }
  </code></pre>
  <p>The final URL will be like
  <a href="https://content.googleapis.com/analytics/v3/data/ga?start-date=2021-04-26&amp;end-date=2021-05-26&amp;ids=ga:myviewid&amp;metrics=ga:pageviews,ga:timeOnPage,ga:uniquePageviews&amp;dimensions=ga:dimension3,ga:dimension2&amp;start-index=1&amp;max-results=10&amp;filters=someexpresson" rel="nofollow noreferrer">https://content.googleapis.com/analytics/v3/data/ga?start-date=2021-04-26&amp;end-date=2021-05-26&amp;ids=ga:myviewid&amp;metrics=ga:pageviews,ga:timeOnPage,ga:uniquePageviews&amp;dimensions=ga:dimension3,ga:dimension2&amp;start-index=1&amp;max-results=10&amp;filters=someexpresson</a></p>
  <p>If any other approach required to save the data, then please let me know as well</p>
  <p>Any suggestion will be helpful.</p>
  <p><strong>Thanks in advance</strong></p>