Biologging tags are a key enabling tool for investigating cetacean behavior and locomotion in their natural habitat. Identifying and then parameterizing gait from movement sensor data is critical for these investigations, but how best to characterize gait from tag data remains an open question. Further, the location and orientation of a tag on an animal in the field are variable and can change multiple times during a deployment. As a result, the relative orientation of the tag with respect to (wrt) the animal must be determined for analysis. Currently, custom scripts that involve species-specific heuristics tend to be used in the literature. These methods require a level of knowledge and experience that can affect the reliability and repeatability of the analysis. Swimming gait is composed of a sequence of body poses that have a specific spatial pattern, and tag-based measurements of this pattern can be utilized to determine the relative orientation of the tag. This work presents an automated data processing pipeline (and software) that takes advantage of these patterns to 1) Identify relative motion between the tag and animal; 2) Estimate the relative orientation of the tag wrt the animal using a data-driven approach; and 3) Calculate gait parameters that are stable and invariant to animal pose. Validation results from bottlenose dolphin tag data show that the average relative orientation error (tag wrt the body) after processing was within 11 degrees in roll, pitch, and yaw directions. The average precision and recall for detecting instances of relative motion in the dolphin data were 0.87 and 0.89, respectively. Tag data from humpback and beluga whales were then used to demonstrate how the gait analysis can be used to enhance tag-based investigations of movement and behavior. The MATLAB source code and data presented in the paper are publicly available (https://github.com/ding-z/cetacean-pose-gait-analysis.git), along with suggested best practices.