google / google-analytics-utilities

Apache License 2.0
188 stars 26 forks source link

nonwhitespace character at 490 #9

Closed Technical-Analytics-Implementation closed 1 year ago

Technical-Analytics-Implementation commented 1 year ago

Hi there!

We are using this utility to try to automate creation of Audiences but there is an error nonwhitespace character at 490.

In the JSON we have an EXCLUDE clausetype and the initial thought is that there is a limitation when using EXCLUDE.

After checking the docs and not finding any resolution, I think this might be expected behavior when EXCLUDING Audiences but I wanted to check here by filing an issue.

Does this utility work when EXCLUDING Audiences?

Thank you.

See JSON below

{
    "clauseType": "INCLUDE",
    "simpleFilter":
    {
        "scope": "AUDIENCE_FILTER_SCOPE_WITHIN_SAME_SESSION",
        "filterExpression":
        {
            "andGroup":
            {
                "filterExpressions": [
                {
                    "orGroup":
                    {
                        "filterExpressions": [
                        {
                            "dimensionOrMetricFilter":
                            {
                                "fieldName": "unifiedPagePathScreen",
                                "stringFilter":
                                {
                                    "value": "verterra",
                                    "matchType": "CONTAINS"                                },
                                "atAnyPointInTime": true                            }
                        },
                        {
                            "dimensionOrMetricFilter":
                            {
                                "fieldName": "unifiedPagePathScreen",
                                "stringFilter":
                                {
                                    "matchType": "CONTAINS",
                                    "value": "/events/alc-tvr"                                },
                                "atAnyPointInTime": true                            }
                        }]
                    }
                }]
            }
        }
    }
},
{
    "simpleFilter":
    {
        "scope": "AUDIENCE_FILTER_SCOPE_ACROSS_ALL_SESSIONS",
        "filterExpression":
        {
            "andGroup":
            {
                "filterExpressions": [
                {
                    "orGroup":
                    {
                        "filterExpressions": [
                        {
                            "dimensionOrMetricFilter":
                            {
                                "atAnyPointInTime": true,
                                "stringFilter":
                                {
                                    "matchType": "CONTAINS",
                                    "value": "form complete"                                },
                                "fieldName": "event_action"                            }
                        },
                        {
                            "dimensionOrMetricFilter":
                            {
                                "fieldName": "unifiedPagePathScreen",
                                "stringFilter":
                                {
                                    "value": "/investor",
                                    "matchType": "CONTAINS"                                },
                                "atAnyPointInTime": true                            }
                        }]
                    }
                }]
            }
        }
    },
    "clauseType": "EXCLUDE"}
b-kuehn commented 1 year ago

Thanks for reporting this! This isn't intended behavior. I'll investigate this to see exactly what might be causing the problem and how to fix the script.

Technical-Analytics-Implementation commented 1 year ago

That would be great! Thank you for the quick response.

b-kuehn commented 1 year ago

This issue has been fixed in the template property and will be pushed to GitHub soon.