<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Aaron O&#039;Neill</title>
	<atom:link href="https://www.aarononeill.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.aarononeill.com</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Mon, 13 Jul 2020 22:06:28 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.5.1</generator>
	<item>
		<title>How To Add Google Analytics to Your WordPress Website</title>
		<link>https://www.aarononeill.com/how-to-add-google-analytics-to-wordpress/</link>
					<comments>https://www.aarononeill.com/how-to-add-google-analytics-to-wordpress/#respond</comments>
		
		<dc:creator><![CDATA[aaron]]></dc:creator>
		<pubDate>Sat, 11 Jul 2020 21:52:58 +0000</pubDate>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Analytics]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tracking]]></category>
		<guid isPermaLink="false">https://www.aarononeill.com/?p=45</guid>

					<description><![CDATA[There are a couple of ways to add Google Analytics to WordPress using the code snippet. Sometimes the easiest solution is to just add another plugin. While that may do exactly what you want, it can also come with more ads on your dashboard but more importantly, you can&#8217;t be sure what it&#8217;s really doing. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>There are a couple of ways to add Google Analytics to WordPress using the code snippet. Sometimes the easiest solution is to just add <em>another</em> plugin. While that may do exactly what you want, it can also come with more ads on your dashboard but more importantly, you can&#8217;t be sure what it&#8217;s really doing.</p>
<p>So, with that in mind, I am going to walk you through the quickest way to add Google Analytics to your theme.</p>
<h2>Where to start</h2>
<p>We&#8217;re going to add our Google Analytics tracking code to your themes <strong>functions.php</strong> file. We will create a new function that contains the code snippet provided by Google.</p>
<div class="note">NOTE: For precautionary reasons, it’s best to create a backup copy of the file before you modify it.</div>
<ol>
<li>You can either open your themes functions file through the admin (Appearance -&gt; Theme Editor) or open the file using a text/code editor. If you&#8217;re not a developer/familiar with SSH/FTP then the first option may be for you, otherwise just reach out to someone who can help with this part.</li>
<li>Next, just copy the snippet below and paste it into the end end of that file.
<pre class="EnlighterJSRAW" data-enlighter-language="php">&lt;php

add_action('wp_head','insert_google_analytics', 20);

function insert_google_analytics() {
?&gt;

  &lt;!-- Paste Your Google Analytics Snippet Here --&gt;
  &lt;!-- See https://www.aarononeill.com/how-to-add-google-analytics-to-wordpress/ for instructions --&gt;

&lt;?php
}</pre>
</li>
<li>Now all you need to do is save your changes and that&#8217;s it!</li>
</ol>
<h3>Now, not to contradict myself&#8230;</h3>
<p>I have made this available as a plugin which you can download on the <a href="https://wordpress.org/plugins/aon-google-analytics/" target="_blank" rel="noopener noreferrer">WordPress plugins page</a>. As above, it&#8217;s very light and very simple so feel free to download it and see how I have put it together.</p>
<p><a href="https://wordpress.org/plugins/aon-google-analytics/" target="_blank" rel="noopener"><img loading="lazy" class="alignnone size-full wp-image-62" src="https://www.aarononeill.com/wp-content/uploads/2020/07/Screenshot-from-2020-07-13-23-03-53.png" alt="" width="959" height="551" srcset="https://www.aarononeill.com/wp-content/uploads/2020/07/Screenshot-from-2020-07-13-23-03-53.png 959w, https://www.aarononeill.com/wp-content/uploads/2020/07/Screenshot-from-2020-07-13-23-03-53-300x172.png 300w, https://www.aarononeill.com/wp-content/uploads/2020/07/Screenshot-from-2020-07-13-23-03-53-768x441.png 768w" sizes="(max-width: 959px) 100vw, 959px" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.aarononeill.com/how-to-add-google-analytics-to-wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
