<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/content-evaluation-what-is-the-value-of-social-media/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://flovv.github.io/Content_Evaluation/"> Florian Teschner</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>As most bloggers, I do check my analytics stats on a regular basis. What I do not really look at is social shares. For most blog posts traffic follows a clear pattern; 2 days of increased traffic, followed by a steady decrease to the base traffic volume.<br>
The amplitude varies massively depending on how interesting/viral the post was. However, in the long-term this virality does not drive the majority of the traffic but rather the search ranking of individual posts, as 80% of the base traffic comes through organic search results.</p>
<p>There is plenty of discussion on the value of a share/like with very different take-aways.<br>
I thought it would be great to analyse if social shares do increase my traffic.</p>
<p>In addition, I realized that it is pretty easy to get the number of Facebook and LinkedIn shares for each of my blog posts from r-bloggers. (Please find the script at the end of the post.)</p>
<p>For the analysis, I scraped the social share numbers and merged them with my Google Analytics stats.<br>
In order to compare the traffic between blog posts, I normalise the total traffic per post by number of days the post is online.</p>
<p>To get a first picture of the data we can plot the normalized traffic over the number of shares (both by blog post).</p>
<p><img alt="plot of chunk unnamed-chunk-3" src="https://i0.wp.com/flovv.github.io/figures/post27/unnamed-chunk-3-1.png?w=456" data-recalc-dims="1"></p>
<p>Next, we can analyse how the variables are correlated. I included the total pageviews as reference.</p>
<figure>
<pre><code data-lang="r"><span>M</span><span> </span><span>&lt;-</span><span> </span><span>cor</span><span>(</span><span>dff</span><span>[,</span><span>c</span><span>(</span><span>&quot;shares&quot;</span><span>,</span><span> </span><span>&quot;linkedIn1&quot;</span><span>,</span><span> </span><span>&quot;pageviews&quot;</span><span>,</span><span> </span><span>&quot;normalizedPageViews&quot;</span><span>)])</span><span>
</span><span>corrplot.mixed</span><span>(</span><span>M</span><span>)</span></code></pre>
</figure>
<p><img alt="plot of chunk unnamed-chunk-4" src="https://i1.wp.com/flovv.github.io/figures/post27/unnamed-chunk-4-1.png?w=456" data-recalc-dims="1"></p>
<p>We see that LinkedIn and Facebook shares are positively correlated with r=.56 and that the correlation between shares and normalized pageviews is the same.<br>
When looking at the total page views we see that have a much lower correlation with shares both from facebook as well as Linkedin.</p>
<p>To determine the “value” of social media to drive traffic volume, we can regress the number of social shares on the normalized traffic numbers.</p>
<figure>
<pre><code data-lang="r"><span>dff</span><span>$</span><span>DaysOnline</span><span> </span><span>&lt;-</span><span> </span><span>as.numeric</span><span>(</span><span>Sys.Date</span><span>()</span><span>-</span><span>dff</span><span>$</span><span>Date</span><span>)</span><span>
</span><span>fit1</span><span> </span><span>&lt;-</span><span> </span><span>lm</span><span>(</span><span>normalizedPageViews</span><span> </span><span>~</span><span> </span><span>shares</span><span> </span><span>+</span><span> </span><span>linkedIn1</span><span>,</span><span> </span><span>data</span><span>=</span><span>dff</span><span>)</span><span>
</span><span>fit2</span><span> </span><span>&lt;-</span><span> </span><span>lm</span><span>(</span><span>normalizedPageViews</span><span> </span><span>~</span><span> </span><span>shares</span><span> </span><span>+</span><span> </span><span>linkedIn1</span><span>,</span><span> </span><span>data</span><span>=</span><span>dff</span><span>)</span><span>
</span><span>fit3</span><span> </span><span>&lt;-</span><span> </span><span>lm</span><span>(</span><span>normalizedPageViews</span><span> </span><span>~</span><span> </span><span>shares</span><span> </span><span>+</span><span> </span><span>linkedIn1</span><span>+</span><span> </span><span>DaysOnline</span><span>,</span><span> </span><span>data</span><span>=</span><span>dff</span><span>)</span><span>
</span><span>stargazer</span><span>(</span><span>fit1</span><span>,</span><span> </span><span>fit2</span><span>,</span><span> </span><span>fit3</span><span>,</span><span> </span><span>type</span><span> </span><span>=</span><span> </span><span>&quot;html&quot;</span><span> </span><span>,</span><span>title</span><span> </span><span>=</span><span> </span><span>&quot;The value of shares for daily traffic&quot;</span><span>)</span></code></pre>
</figure>
<table>
<caption><strong>The value of shares for daily traffic</strong></caption>
<tr>
<td colspan="4"></td>
</tr>
<tr>
<td></td>
<td colspan="3"><em>Dependent variable:</em></td>
</tr>
<tr>
<td></td>
<td colspan="3"></td>
</tr>
<tr>
<td></td>
<td colspan="3">normalizedPageViews</td>
</tr>
<tr>
<td></td>
<td>(1)</td>
<td>(2)</td>
<td>(3)</td>
</tr>
<tr>
<td colspan="4"></td>
</tr>
<tr>
<td>shares</td>
<td>0.043<sup>**</sup></td>
<td>0.043<sup>**</sup></td>
<td>0.026</td>
</tr>
<tr>
<td></td>
<td>(0.017)</td>
<td>(0.017)</td>
<td>(0.022)</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>linkedIn1</td>
<td>0.138</td>
<td>0.138</td>
<td>0.101</td>
</tr>
<tr>
<td></td>
<td>(0.126)</td>
<td>(0.126)</td>
<td>(0.129)</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>DaysOnline</td>
<td></td>
<td></td>
<td>-0.008</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td>(0.006)</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Constant</td>
<td>1.462</td>
<td>1.462</td>
<td>5.744</td>
</tr>
<tr>
<td></td>
<td>(1.114)</td>
<td>(1.114)</td>
<td>(3.571)</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="4"></td>
</tr>
<tr>
<td>Observations</td>
<td>33</td>
<td>33</td>
<td>33</td>
</tr>
<tr>
<td>R<sup>2</sup></td>
<td>0.341</td>
<td>0.341</td>
<td>0.375</td>
</tr>
<tr>
<td>Adjusted R<sup>2</sup></td>
<td>0.297</td>
<td>0.297</td>
<td>0.310</td>
</tr>
<tr>
<td>Residual Std. Error</td>
<td>5.042 (df = 30)</td>
<td>5.042 (df = 30)</td>
<td>4.994 (df = 29)</td>
</tr>
<tr>
<td>F Statistic</td>
<td>7.755<sup>***</sup> (df = 2; 30)</td>
<td>7.755<sup>***</sup> (df = 2; 30)</td>
<td>5.802<sup>***</sup> (df = 3; 29)</td>
</tr>
<tr>
<td colspan="4"></td>
</tr>
<tr>
<td><em>Note:</em></td>
<td colspan="3"><sup>*</sup>p&lt;0.1; <sup>**</sup>p&lt;0.05; <sup>***</sup>p&lt;0.01</td>
</tr>
</table>
<p>As in the correlation plot, we see that highly shared posts have more daily visits. If you take the estimates at face value one can also state that a linkedIn share is worth 3 times a facebook share in terms of additional traffic.<br>
In the last regression I also included a variable (DaysOnline) to capture my learning effect. The longer post is online the lower is the daily traffic. (e.g. posts published when I started blogging).</p>
<p>While writing this post, I realized that the script can also be used to analyse;</p>
<ul>
<li>which topics are highly shared</li>
<li>which authors are popular</li>
<li>how social sharing changed over time<br>
on r-bloggers.</li>
</ul>
<p>Have fun!</p>
<p></p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://flovv.github.io/Content_Evaluation/"> Florian Teschner</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/Omj4ekrGKhA" height="1"></a></div>