I do this all the time as well.
This is the adapter that I have:
https://www.amazon.com/dp/B01L2BLRAW/
Cheaper, and it doesn't have the pigtail part. I would think that it might be a little bit harder to accidentally come unplugged by a animal or human walking on the cord and unplugging it.
Just another option...