Yes it can be taken for long periods but GERD cause should be treated.
Diet lifestyle stress are few important causes.
Avoid stress. Various methods to remove known or unknown stress in life like excercises, giving time to self, yoga meditation etc can be adopted.
Next Steps
avoid spicy foods coffee tea cold drinks alcohol smoking junk food etc.
Health Tips
plant based diet is the ideal diet. CONSTIPATION if present has to be treated.