Here's how it works for the non-Americans of us:
"I pledge allegiance to the Flag of the United States of America, and to the Republic for which it stands, one Nation under God, indivisible, with liberty and justice for all," should be rendered by standing at attention facing the flag with the right hand over the heart.
Remembering this often-forgotten detail puts a lot of US culture and behaviour in perspective. Also let's not forget the Bellamy salute, in use for 50 years until 1942: https://en.wikipedia.org/wiki/Bellamy_salute
---
1: and in congressional sessions, government meetings at local levels, and meetings held by many private organizations, according to Wikipedia