Hi cragley,
You probably haven't used Avast in PUP-mode (not as per default) to avoid this PUP/Adware.
It was very likely that this adware pest came riding in on the back of some bundled software.
Bundling crap is a growing annoyance now, so users should be very aware of the "costs" of the so-called freeware,
where you are the product and sometimes made into a victim also.
To get best rid of this follow the routines to get assistance and a cleansing routine from one of our qualified removal experts:
https://forum.avast.com/index.php?topic=53253.0 (follow instructions given there),
polonus