sam222 - As you've phrased your question, it sounds like it's largely about Google AdWords landing page setup.
There is an SEO aspect to your question, though, about the possibility of duplicate content if example.com and example.com?g=code have the same content. For that reason, it's best to make your AdWords URLs to be a specific landing pages for selected keywords, in this form...
...and to block them from spidering or indexing, either with robots.txt, or with the meta robots noindex tag.
I would not direct AdWords to your home page, because you clearly want that available to Googlebot for organic indexing... so you wouldn't want to block it.
..and to block them from spidering or indexing, either with robots.txt, or with the meta robots noindex tag
I believe Google puts Adwords links on different competitors websites as adsense and if i create new URLs with no index i am afraid i won't be able to get backlink to my original example.com URL from those Google adsense.
The light box might be a policy concern, depending on what you're doing with it, but merely having variables in your URLs used for Google ads should cause no problems for your organic SEO. Especially not if you're using the canonical tag correctly.
For starters, URLs that appear within AdSense ads (or other ad networks) do not get normally counted as backlinks.
If a user copied your landing-URL-with-variables and posted it directly on a regular page someplace, that would put the URL into organic circulation, but in my experience that doesn't happen often enough to be a practical concern, not even in the days before the canonical tag was developed.
My advice: Make your decisions about what landing pages / URLs to use for AdWords based on the logic of your sales funnel, not organic SEO worries.