How to convert touch position to canvas position?

I’ve tried many things, with little to no success. My main goal is to convert a touch position into canvas position. Any help you could provide is much appreciated.

I know this is a little old but man did this take some googling so sharing my solution here for future coders. hope this helps

                    var touchpoint = Instantiate(Resources.Load("prefabs/touchpoint"), new Vector3(0, 0, 0), Quaternion.identity) as GameObject;
                    //set it parent to the main canvas
                    touchpoint.transform.parent = MainCanvas.transform;
                    //convert touch position to localposition reletive to canvas
                    Vector2 localPos;
                    RectTransformUtility.ScreenPointToLocalPointInRectangle(MainCanvasRect, new Vector3(t.position.x, t.position.y, 0), null, out localPos);
                    //set position on canvas
                    touchpoint.transform.localPosition = localPos;

No reply WTF!

I have this so far but it doesnt scale correctly

    Vector2 screen = new Vector2(Screen.width, Screen.height);

    Vector3 ConvertTouchToCameraUIPoint(Vector3 position) {
        Vector3 pos = Camera.main.ScreenToViewportPoint(position) - new Vector3(.5f, .5f, 0);
        pos = pos * screen * .025f;
        return(new Vector3(pos.x, pos.y, 0));