Another strat I found effective early on was to move as much of my gold and resources from the town being attacked to a town that's not being attacked, if you happen to have two towns. I did this after a scout had visited and before the attack. You still take the defensive losses, but the attacker may figure it's not worth the time to attack you again if you're moving your resources.