I'm looking to write a script that dynamically replaces elements of my page with content related to the keyword that resulted in a PPC click. For example, visiting the landing page after searching on "purple widgets" would replace the hero image with an image of a purple widget, and the h1 with copy related to purple widgets.
How does this affect quality score? Are there any downsides of doing this?