Problems with filament not sticking to the bed are usually because the nozzle is too far from the bed for the first layer or a bed that needs cleaning.
Suggest you look at some of the numerous videos on Youtube about getting a good first layer and setting the 'Z' offset.

Try just using the start and end G-codes that are in the printer profile.