Learn business growth with Google Analytics 4 Forums Google Analytics 4 Extract pure JSON data using Google Analytics Data API v1 runReport Reply To: Extract pure JSON data using Google Analytics Data API v1 runReport

  • Ngoc

    Member
    9 July 2023 at 4:12 am

    It seems like the response might be an object that doesn’t directly serialize to JSON. This could be why you’re getting empty braces when you try to print it as such. Although you may not be able to directly convert the response to pure JSON, you could try to iterate through the object and manually build a new one that can be properly serialized. Alternatively, consider delving into the respective PHP methods or using var_dump() to better understand the structure of the response object. This may provide some insight into why the direct conversion isn’t working and what can be done to correct it. Be sure to also check the API documentation for any guidance on how the response should be handled.