But I think that a large part of the problem especially in France is that the French haven't done enough to integrate immigrants into French society.
Well, I think the biggest part of the problem is that the Muslims in France are a random sample or at least a more random sample than Muslims going to e.g. the USA, who must come to terms with the fact that they go there for a better life alone, because otherwise they could go to a much less controversial place for a Muslim, like France. And average Muslims don't want to assimilate, since theirs is one of the cultures that see assimilation as bad. Think of all the wudhu' rules, food taboos, no marrying outside Islam, that sort of self-isolating culture that permeates even the non-religious among them.
Or rather imagine how would
you look at a population whose cuisine included roadkill ripened in noon heat, whose bathing culture did not extend beyond wiping their hands on their hair, who have been described by your valued literature as eating like animals on account of having seven intestines, that sort of thing. Well, people from cultures with 'purity laws', specifically Muslims, Jews, Hindus et. al. regard us regular folks in some shade of that manner, not primarily because they themselves keep away from such abominations - often they don't even know all the rules, or don't care about them - but because they are the products of a culture which included the indirect hints about the subhuman status of outsiders for centuries. You can work with them, 'befriend' them and they won't even bring it up; would you bring up lack of hygiene or disapproval of one's food preferences with someone? Sometimes they can't even voice the issue themselves, so obvious and I-didnt-think-it-needs-mention level of trivial it seems to them that they are the vanguard of an elite civilization.
I think that this is at least one of the reasons why France is where the majority of these attacks have occurred.
France is a well-established figurehead of 'Western intervention' in the Levant. America as the Great Satan is relatively new; to them, France and not the USA was sort of the Great Satan since the late 1800's.