Preparation and application of conducting polymers containing chemically active counterions for analytical purposes