Why is my iPod touch not detecting the plug in cord when I plug it in?

Well I have a iPod touch and of course a charger but lately when I plug the iPod in
To the cord and I leave it there for a day and come back to unplug it and play my games and watch YouTube it won't turn on so I hold down the power button and it shows the sign that there is no power in the iPod!So I have to plug it in a few times before I works and starts charging and it took me and hour to get my battery charge that I have right now.Right now it's 1/2 charged and I have pluged it in 1 million times but now it won't detect it.So I think something isn't detecting the plug but that's all I know!Can you guys help me out with this?😕