Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Raw export JSON invalid

Discussion in 'Unity Analytics' started by coshea, Jul 29, 2020.

Thread Status:
Not open for further replies.
  1. coshea

    coshea

    Joined:
    Dec 20, 2012
    Posts:
    319
    Hi
    I thought I'd make my own heatmap using custom events for debug during testing. I exported some custom event data from Unity Analytics, went to load it in the JSON parser in Unity and got an error "JSON parse error: The document root must not follow by other values."

    I copied the JSON output from the portal into various JSON validators, they all came back fail. Multiple JSON root elements

    Analytics raw output is like this:

    {"name":"event","userid":"123"}
    {"name":"event","userid":"123"}
    {"name":"event","userid":"123"}

    so Isn't valid JSON. Shouldn't it output something like this?

    [{"name":"event","userid":"123"},
    {"name":"event","userid":"123"},
    {"name":"event","userid":"123"}]

    Thanks
     
  2. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    It seems some error occurred at that time, could you try it again?
     
  3. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Each data row in Raw Data Export is it's own JSON document, by design.
     
  4. Swathi-RS

    Swathi-RS

    Joined:
    Oct 19, 2020
    Posts:
    21
    Hi, i am also facing same issue. How to fix it? Please help
     
  5. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    The Raw Data Export uses newline delimited json so each line represents a valid JSON value:
    http://ndjson.org/
     
Thread Status:
Not open for further replies.