You can think of 갔었던 as an emphasized form of 갔던 without clear distinction in meaning.
The verb stem 갔 and 갔었 are more distinctive when they are used as a predicate at the end of a sentence.
For example, compare these different tense examples based on 이민 가다 (immigrate):
1 친구는 이민 간다 -> 이민 가는 친구- He is going now (or in the near future).
2 친구는 이민 갔다 -> 이민 간 친구. He has gone, and not here anymore.
3 친구는 이민 갔었다 -> 이민 [갔던 / 갔었던] 친구. He had gone, and may have subsequently come back.
The difference between 갔다 and 갔었다 is huge, as it is the difference between whether he's here(the latter) or not.
Confusingly though, the difference between 갔던 and 갔었던 is almost nonexistent.
(The reason for this is because the ending 던 already has a strong sense of past in it, and ㅆ furthers that)
The important thing is that the adjective form for 갔다 is 간, not 갔던 as might appear correct to you.
You can use either 갔던 or 갔었던 for #3, but 갔었던 with 었 gives the impression it was further in the past.
So 갔었던 is often preferred for emphasis even though 갔던 carries almost the same meaning.
Also, there is 가던 as well to complete the -던 forms:
"-던" without the ㅆ 받침 indicate an action or state that recurred or lasted for a while in the past (like "used to").
- 내가 자주 가던 찻집: The cafe I used to frequent.
- 내가 수행하던 프로젝트: The project I used to work on.