Spotting after period???

I started my period on the 23rd I was bleeding pretty heavy and it was lighter after a few days like 3 days , My bleeding would be heavy then light and back and forth. Im still bleeding here and there but I did have sex during my period (dont judge) idk if thats whats causing my on and off bleeding or ???