how to do dimentsion filter dynamically?

Dec 22, 2014 at 5:31 PM
Edited Dec 22, 2014 at 5:31 PM

I am trying to send adwords customer ID dimension filter but I cant figure out how can I do this using a variable? how to pass it through an experssion? for example: profileId, I can pass as shown below, how about the dimension filter?

Feb 5, 2015 at 12:20 AM
Edited Feb 5, 2015 at 12:25 AM
You'll need to do a few of things:-
  1. Declare a string variable/parameter in the package (say paramDimensionFilters).
  2. Set the value of this variable/param programmatically by building a string in this format::
    <dimension> <operator> <value> and then assign this value to the variable/param.
    e.g if I wanted to filter the SourceMedium dimension for the value "Google", the assignment would look like
    paramDimensionFilter = "ga:sourceMedium == Google" (include the quotes)
  3. assign the paramDimensionFilter to the "DimensionFilters" property of the GA adapter via an expression, just like any other expression value.
You can set any value for paramDimensionFilter manually or programmatically at run time and it'll reflect that in the call to the GA reporting API once the adapter submits the query to GA.

P.S: here is a link to the various operators that are available for GA filters (dimensions and metrics) and how they translate:

Hope this helps.

Apr 13, 2015 at 4:31 PM
I haven't been able to get the dimensions filter to work properly. I have a few API calls that utilize the dimensions filter. The SSIS package fails on the Pre-Execute phase when I attempt to use more than one filter criteria. Based on Google's dev guide, multiple filters can be separated by a comma or a semicolon depending on OR or AND criteria.

I've been able to do some troubleshooting, just using one criteria and I have found in that case, the package does not fail, however, when the job runs, the Dimensions Filter is ignored and is not appended on to the API call. Screenshot:

Let me, please, if you have any thoughts or suggestions on how to get dimensions to work. I've tried both ways using a variable and hard coding it in.