We do Not use melatonin as it is not available on prescription for children where we live, but have had good results with magnesium citrate when Ds1 took hours to fall asleep every night. Just in case you want to try an alternative.
A recommended dosage is 200 mg, you may have to play around with it because a overdose will give you diarrhea. Pleasant side effect if your kid happens to be a picky eater as well and you have a hard time getting those fruit and veggies in so your kid is constipated, you may have normal bowel function instead, without meds or other side effects.