Constants for Composition of functions

Let f(x) = ax+b and g(x) =cx+d where a,b,c,d are constants. Determine for which constants a,b,c,d it is true that f o g = g o f.

I am not very sure how to approach this problem. I simplifed the f o g and g o f but after that I am not sure how to go from there.

Here is what I did first

f(g(x)) = g(f(x))

a(cx+d) +b = c(ax+b) +d

acx+ad+b = cax + cb +d

then after that I got stuck. I tried switching around the varibles on either side and tried to get them to equal to eachother, however that didn't work. Am I'm going in the right direction or am I totally off? Thank you for your help!!!

acx-acx = cb +d

ad+b = cb +d

ad -d = cb -b

d(a-1) = b(c-1)

that is where I got stuck

Thank you for your help!