Review the sentence:
Drooling in anticipation of the treat, a dog cookie was given to Gizmo.
Drooling in anticipation of the treat, a participle phrase, is right next to dog cookie, an illogical target. Cookies don't salivate!
Before you continue, review the rules for misplaced and dangling modifiers.