Learn business growth with Google Analytics 4 Forums Google Analytics 4 Troubleshooting Duplicate Column Error in GA4 Property Filter with Google Analytics Data API in R Reply To: Troubleshooting Duplicate Column Error in GA4 Property Filter with Google Analytics Data API in R

  • Sebastian

    Member
    13 October 2022 at 7:06 pm

    The issue you’re facing seems to be related to the last line of your code where you’re attempting to filter data by city. According to the error you’re receiving, there appear to be duplicate column names in your data. In simple words, there’s an issue with your data set having two (or more) columns with the same name, which is making it hard for R to understand which one to use.

    Now, just focusing on the last line of your code where you seem to be getting the error, you’re making a call to ga_data_filter function with parameters for city to equal “Copenhagen” or “London”. When this line of code is executed properly, it should return a filter object which includes references to filters for the cities “Copenhagen” and “London” separately. It seems that there’s nothing wrong with this line as per the provided syntax.

    Just to make sure everything is working right, you might want to check if your installed version of the R package rlang is up-to-date. The requirement is for it to be version 1.02 or later.