So, what I do is make sure that I am exporting my lottie animation in the right aspect ratio or pixel depth needed to ensure it fits into the design as originally needed.
For example, I work in 4k for longevity of the file but I need to give my web designer an 800x600 animation. Here’s the numbers:
4K Master File: 3840 x 2160
800x600 Crop: 2880 x 2160
So I make a duplicate of the main comp and crop it to 2880x2160 which will be an 800x600 aspect ratio (using aspect ratio wrong here, but trying to get the point across)