The nice things about the long adventure books of D&D or Pathfinder Adventure Paths is that they make the brunt of the work of creating a long campaign off the GMs shoulders. You have a book in front of you; just do what it says comes next. The down side: the player characters are interchangeable. Standard balanced party, great. Party of clerics, all good. Three fighters and a druid, sure. As such, they can feel like the characters don’t have a connection to the campaign. They don’t feel their particular character is invested in the campaign. So what do you do?
1) Have The Players Describe a Connection
This one can be kind of cheap, but it’s effective, at least for the beginning of a campaign. Here you’re asking for characters to come up with a connection to the campaign through a common NPC. Make them all like the NPC or outright hate them; don’t mix and match. If you’re going for like, something has to happen to the NPC. If it is hatred, they’re banding together for revenge. Either way, this gives the group of strangers a reason to work together and begin adventuring.
Like I said, this one is cheap because either you’re solving this quickly and getting to the main campaign where you’re back to the original problem of characters being interchangeable or it’s a sizable chunk of the campaign, if not the whole campaign, at which point you’re back to the main problem. So how do you keep players feeling their characters are invested throughout the whole campaign?
2) Modify an Arc
Adventure Paths have multiple books, each telling an independent story that build towards the main story. Long campaign books are divided into various sections where the parts of the story make up the larger whole. You don’t need to do major rewrites to incorporate a character’s backstory and help them feel invested. Instead it can be as easily as renaming someone or adding some flavor to their backstory. A backstory describes a parent being murdered by a six-fingered person and stole a precious sword. Boom! The main bad guy of this section now has an extra digit and their weapon is familiar to the character. Someone is the last of their people? That is what the helpful NPC thought as well. Someone wants to reclaim a relic? Guess what the bad guy of an arc is wielding now.
3) Add a Side Quest
Between chapters of a long campaign or books in an adventure path is the perfect time for a side quest. Either write it yourself or use a short adventure module. Just make sure that it directly ties into the characters and their backstories. This is a fun way to give your players something directly relevant to their characters as well as reward them with some unique magic items and more. Plus it gives them a bit of extra experience, covering encounters they may have missed earlier, and it breaks up the main story line, giving the players some breathing room. It’s an all around win-win.