<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Google Adwords Dynamic Keyword Insertion PHP Script</title>
	<atom:link href="http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/</link>
	<description>Dave Wooding</description>
	<lastBuildDate>Fri, 06 Jan 2012 19:35:15 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: admin</title>
		<link>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/comment-page-1/#comment-6465</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 06 Jan 2012 19:35:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.davewooding.com/?p=4#comment-6465</guid>
		<description>If you want to do dynamic keyword insertion on multiple Wordpress pages and know which page/post the visitor will land on for a particular keyword, then instead of this as your destination url:

hxxp://www.example.com/{KeyWord: Default}.html

You could do this:

hxxp://www.example/a-particular-page/?keyword={KeyWord: Default}

Create a short code function in wordpress that sets a cookie (or session) variable for that keyword.  Then use that short code inside your page or post.

Something like this in your functions.php file for your theme:

function custom_keyword() {
	if (!$isset($_COOKIE[&#039;keyword&#039;])) {
		setcookie(&quot;keyword&quot;, strip_tags(trim($_GET[&#039;keyword&#039;])));
	}
	return $_COOKIE[&#039;keyword&#039;];
}

add_shortcode(&#039;keyword&#039;, &#039;custom_keyword&#039;);

P.S. - Completely winging it on this - not sure if this will work or even answers your question ...

P.S.S. - Or &lt;a href=&quot;http://2c60b58iq4rgho9e1grrng2e50.hop.clickbank.net/?tid=DKI&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;pay for it&lt;/a&gt; (yes, that is an affiliate link).</description>
		<content:encoded><![CDATA[<p>If you want to do dynamic keyword insertion on multiple WordPress pages and know which page/post the visitor will land on for a particular keyword, then instead of this as your destination url:</p>
<p>hxxp://www.example.com/{KeyWord: Default}.html</p>
<p>You could do this:</p>
<p>hxxp://www.example/a-particular-page/?keyword={KeyWord: Default}</p>
<p>Create a short code function in wordpress that sets a cookie (or session) variable for that keyword.  Then use that short code inside your page or post.</p>
<p>Something like this in your functions.php file for your theme:</p>
<p>function custom_keyword() {<br />
	if (!$isset($_COOKIE['keyword'])) {<br />
		setcookie(&#8220;keyword&#8221;, strip_tags(trim($_GET['keyword'])));<br />
	}<br />
	return $_COOKIE['keyword'];<br />
}</p>
<p>add_shortcode(&#8216;keyword&#8217;, &#8216;custom_keyword&#8217;);</p>
<p>P.S. &#8211; Completely winging it on this &#8211; not sure if this will work or even answers your question &#8230;</p>
<p>P.S.S. &#8211; Or <a href="http://2c60b58iq4rgho9e1grrng2e50.hop.clickbank.net/?tid=DKI" target="_blank" rel="nofollow">pay for it</a> (yes, that is an affiliate link).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jaytim</title>
		<link>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/comment-page-1/#comment-6459</link>
		<dc:creator>jaytim</dc:creator>
		<pubDate>Fri, 06 Jan 2012 18:47:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.davewooding.com/?p=4#comment-6459</guid>
		<description>Dave,

That was a great description -- thanks.

I need to tweak it slightly; I want to do dynamic keyword insertion into multiple existing Wordpress pages, so I can&#039;t use the index.html file. Obviously for each inbound Adwords visit I will know which &#039;base page&#039; I want to be customized with the appropriate URL, and I can include this in some way in the starting URL.

How could I do this?</description>
		<content:encoded><![CDATA[<p>Dave,</p>
<p>That was a great description &#8212; thanks.</p>
<p>I need to tweak it slightly; I want to do dynamic keyword insertion into multiple existing WordPress pages, so I can&#8217;t use the index.html file. Obviously for each inbound Adwords visit I will know which &#8216;base page&#8217; I want to be customized with the appropriate URL, and I can include this in some way in the starting URL.</p>
<p>How could I do this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/comment-page-1/#comment-1874</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Thu, 20 Jan 2011 20:10:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.davewooding.com/?p=4#comment-1874</guid>
		<description>Tim,

Off hand, no.

Would you provide an example of your title?  When you say you know the keyword is less than 25 spaces for the title, does that include any other content in your title?

http://adwords.google.com/support/aw/bin/answer.py?hl=en&amp;safe=on&amp;answer=46454

Use the contact link if you would like to provide a specific example, http://www.davewooding.com/contact/

Thanks.

Dave</description>
		<content:encoded><![CDATA[<p>Tim,</p>
<p>Off hand, no.</p>
<p>Would you provide an example of your title?  When you say you know the keyword is less than 25 spaces for the title, does that include any other content in your title?</p>
<p><a href="http://adwords.google.com/support/aw/bin/answer.py?hl=en&#038;safe=on&#038;answer=46454" rel="nofollow">http://adwords.google.com/support/aw/bin/answer.py?hl=en&#038;safe=on&#038;answer=46454</a></p>
<p>Use the contact link if you would like to provide a specific example, <a href="http://www.davewooding.com/contact/" rel="nofollow">http://www.davewooding.com/contact/</a></p>
<p>Thanks.</p>
<p>Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/comment-page-1/#comment-1872</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Thu, 20 Jan 2011 19:57:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.davewooding.com/?p=4#comment-1872</guid>
		<description>Dave,

I have followed all the instruction in using dynamic keywords in my title and line text but I can only get the default text to appear in my ad.  This is occurring when I know the keyword is less than 25 spaces for the title.  Do you have any suggestions?

Thanks,

Tim</description>
		<content:encoded><![CDATA[<p>Dave,</p>
<p>I have followed all the instruction in using dynamic keywords in my title and line text but I can only get the default text to appear in my ad.  This is occurring when I know the keyword is less than 25 spaces for the title.  Do you have any suggestions?</p>
<p>Thanks,</p>
<p>Tim</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/comment-page-1/#comment-1486</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Mon, 15 Nov 2010 17:53:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.davewooding.com/?p=4#comment-1486</guid>
		<description>Hi Paul,

If you want to be absolutely positive, then run an Adwords campaign and click on one of your ads :)

Otherwise, create a link to your site like this:  hxxp://www.example.com/test-keyword.html and visit that page checking that &quot;test keyword&quot; shows up as expected.

Dave</description>
		<content:encoded><![CDATA[<p>Hi Paul,</p>
<p>If you want to be absolutely positive, then run an Adwords campaign and click on one of your ads <img src='http://www.davewooding.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Otherwise, create a link to your site like this:  hxxp://www.example.com/test-keyword.html and visit that page checking that &#8220;test keyword&#8221; shows up as expected.</p>
<p>Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Neal</title>
		<link>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/comment-page-1/#comment-1485</link>
		<dc:creator>Paul Neal</dc:creator>
		<pubDate>Mon, 15 Nov 2010 17:48:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.davewooding.com/?p=4#comment-1485</guid>
		<description>Dave,

Thanks for your post...great info. What would be a good way to test the code after making the changes to ensure that it is working properly?

Thanks,
Paul</description>
		<content:encoded><![CDATA[<p>Dave,</p>
<p>Thanks for your post&#8230;great info. What would be a good way to test the code after making the changes to ensure that it is working properly?</p>
<p>Thanks,<br />
Paul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff</title>
		<link>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/comment-page-1/#comment-1067</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Mon, 20 Sep 2010 22:09:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.davewooding.com/?p=4#comment-1067</guid>
		<description>Dave,
Thanks for your response.

I had another look at the various files I acquired with the original script, I had neglected to change the $_GET variable, and looking at the .htaccess file I needed to change the base variable. I now have the desired end result.

If you go to www.____/___/xxx.html change the xxx for any single word term, it should return an index page showing the value you used as xxx as a keyword and also in the page title. Then if you change the xxx to another value, such as kobe beef another page is displayed. 
The resultant page is very basic, I will now be able to work on the rest of the design.</description>
		<content:encoded><![CDATA[<p>Dave,<br />
Thanks for your response.</p>
<p>I had another look at the various files I acquired with the original script, I had neglected to change the $_GET variable, and looking at the .htaccess file I needed to change the base variable. I now have the desired end result.</p>
<p>If you go to <a href="http://www.____/___/xxx.html" rel="nofollow">http://www.____/___/xxx.html</a> change the xxx for any single word term, it should return an index page showing the value you used as xxx as a keyword and also in the page title. Then if you change the xxx to another value, such as kobe beef another page is displayed.<br />
The resultant page is very basic, I will now be able to work on the rest of the design.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/comment-page-1/#comment-1065</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Mon, 20 Sep 2010 18:04:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.davewooding.com/?p=4#comment-1065</guid>
		<description>Hi Jeff,

From your description, it sounds like the solution is to remove:

RewriteBase /

from the .htaccess file in the subdirectory.

If that doesn&#039;t work, use the contact link to send me more details.

Thanks.

Dave

UPDATE:  This solution works for subdirectories.  Include a .htaccess in your subdirectory that looks like this.

RewriteEngine On
RewriteBase /subdirectory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+).html?$ index.php?q=$1 [L]

Replace subdirectory with the appropriate subdirectory name</description>
		<content:encoded><![CDATA[<p>Hi Jeff,</p>
<p>From your description, it sounds like the solution is to remove:</p>
<p>RewriteBase /</p>
<p>from the .htaccess file in the subdirectory.</p>
<p>If that doesn&#8217;t work, use the contact link to send me more details.</p>
<p>Thanks.</p>
<p>Dave</p>
<p>UPDATE:  This solution works for subdirectories.  Include a .htaccess in your subdirectory that looks like this.</p>
<p>RewriteEngine On<br />
RewriteBase /subdirectory<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule ^([^/]+).html?$ index.php?q=$1 [L]</p>
<p>Replace subdirectory with the appropriate subdirectory name</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff</title>
		<link>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/comment-page-1/#comment-1063</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Mon, 20 Sep 2010 15:47:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.davewooding.com/?p=4#comment-1063</guid>
		<description>Dave,
Great article. By far the most informative I seen thus far on dynamic keyword insertion.
I am trying to incorporate this into an existing website, and despite following the article fully I am unable to obtain the desired result.
I have a sub directory on my site where I wish this to work. The sub directory has an index.php file already and I copied the contents of the rewrite code into a .htaccess file which is also in the subdirectory. I note you indicate the .htaccess file should be in the root, but I am concerned it may affect existing code within the .htaccess file already in the root, if I add the rewrite code.
Can you offer any further assistance, or am I going about this completely the wrong way. I am not too concenred with the AdWords element of the article, only the section relating to displaying a page relative to the search term i.e. the /xxxx.html

Please feel free to email me if you require more information.

Regards and again thanks for a very informative article.

Jeff</description>
		<content:encoded><![CDATA[<p>Dave,<br />
Great article. By far the most informative I seen thus far on dynamic keyword insertion.<br />
I am trying to incorporate this into an existing website, and despite following the article fully I am unable to obtain the desired result.<br />
I have a sub directory on my site where I wish this to work. The sub directory has an index.php file already and I copied the contents of the rewrite code into a .htaccess file which is also in the subdirectory. I note you indicate the .htaccess file should be in the root, but I am concerned it may affect existing code within the .htaccess file already in the root, if I add the rewrite code.<br />
Can you offer any further assistance, or am I going about this completely the wrong way. I am not too concenred with the AdWords element of the article, only the section relating to displaying a page relative to the search term i.e. the /xxxx.html</p>
<p>Please feel free to email me if you require more information.</p>
<p>Regards and again thanks for a very informative article.</p>
<p>Jeff</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/comment-page-1/#comment-596</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Sat, 07 Aug 2010 19:47:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.davewooding.com/?p=4#comment-596</guid>
		<description>Jarad,

Good questions.

The added &quot;-&quot; is overkill on my part.  It just makes the urls prettier (hxxp://www.davewooding.com/kobe-beef.html versus hxxp://www.davewooding.com/kobe%20beef.html).

The way I handle the incoming keyword, i.e. - preg_replace(&quot;/-/&quot;, &quot; &quot;, $keyword);, will display kobe-beef.html and kobe%20beef.html the same way, &quot;kobe beef&quot;.

Thanks.

Dave</description>
		<content:encoded><![CDATA[<p>Jarad,</p>
<p>Good questions.</p>
<p>The added &#8220;-&#8221; is overkill on my part.  It just makes the urls prettier (hxxp://www.davewooding.com/kobe-beef.html versus hxxp://www.davewooding.com/kobe%20beef.html).</p>
<p>The way I handle the incoming keyword, i.e. &#8211; preg_replace(&#8220;/-/&#8221;, &#8221; &#8220;, $keyword);, will display kobe-beef.html and kobe%20beef.html the same way, &#8220;kobe beef&#8221;.</p>
<p>Thanks.</p>
<p>Dave</p>
]]></content:encoded>
	</item>
</channel>
</rss>

