Skip to content

Commit 3823fc0

Browse files
committed
adding snippet for sponsor link
1 parent 87b4f80 commit 3823fc0

File tree

12 files changed

+52
-16
lines changed

12 files changed

+52
-16
lines changed

all.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,8 @@ <h2>New to programming</h2>
374374
<li>
375375
<p>To get an introduction to Python, Django and Flask at the same time,
376376
consider purchasing the
377-
<a href="http://www.realpython.com/?utm_source=fullstackpython&amp;utm_medium=referral&amp;utm_campaign=best_resources_page">Real Python</a> course by Fletcher, Michael and
378-
Jeremy.</p>
377+
<a href="http://www.realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=best_resources_page" onclick="trackOutboundLink('http://www.realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=best_resources_page'); return false;">Real Python</a>
378+
course by Fletcher, Michael and Jeremy.</p>
379379
</li>
380380
<li>
381381
<p>If you've never programmed before check out the

best-python-resources.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ <h2>New to programming</h2>
5151
<li>
5252
<p>To get an introduction to Python, Django and Flask at the same time,
5353
consider purchasing the
54-
<a href="http://www.realpython.com/?utm_source=fullstackpython&amp;utm_medium=referral&amp;utm_campaign=best_resources_page">Real Python</a> course by Fletcher, Michael and
55-
Jeremy.</p>
54+
<a href="http://www.realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=best_resources_page" onclick="trackOutboundLink('http://www.realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=best_resources_page'); return false;">Real Python</a>
55+
course by Fletcher, Michael and Jeremy.</p>
5656
</li>
5757
<li>
5858
<p>If you've never programmed before check out the
@@ -290,7 +290,7 @@ <h3 class="panel-head">Sponsored By</h3>
290290
<a href="https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=best_resources_page"><img src="theme/img/sponsored/realpython.png" alt="Real Python logo" width="100%"></a>
291291
<p style="font-size: .8em;">If you want to learn Python then
292292
I highly recommend
293-
<a href="https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=best_python_resources">checking out Real Python</a>'s
293+
<a href="https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=best_python_resources" onclick="trackOutboundLink('https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=best_resources_page'); return false;">checking out Real Python</a>'s
294294
courses.
295295
</p>
296296
</div>
@@ -372,5 +372,6 @@ <h3 class="panel-head"><a href="/table-of-contents.html" style="color: #fff;">Ta
372372
</div>
373373
<link href="theme/css/f.min.css" rel="stylesheet">
374374
<link href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.css" rel="stylesheet">
375+
<script type="text/javascript" src="theme/js/track_out.js"></script>
375376
</body>
376377
</html>

django.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ <h3 class="panel-head">Sponsored By</h3>
448448
<a href="https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=django_page"><img src="theme/img/sponsored/realpython.png" alt="Real Python logo" width="100%"></a>
449449
<p style="font-size: .8em;">If you're searching for step-by-step Django
450450
tutorials then I highly recommend
451-
<a href="https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=django_page">checking out Real Python</a>.
451+
<a href="https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=django_page" onclick="trackOutboundLink('https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=django_page'); return false;">checking out Real Python</a>.
452452
</p>
453453
</div>
454454
</div>
@@ -537,5 +537,6 @@ <h3 class="panel-head"><a href="/table-of-contents.html" style="color: #fff;">Ta
537537
var b=document.getElementsByTagName("script")[0];
538538
a.src=document.location.protocol+"//script.crazyegg.com/pages/scripts/0016/5846.js?"+Math.floor(new Date().getTime()/3600000);
539539
a.async=true;a.type="text/javascript";b.parentNode.insertBefore(a,b)}, 1);
540-
</script></body>
540+
</script><script type="text/javascript" src="theme/js/track_out.js"></script>
541+
</body>
541542
</html>

feeds/all.atom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<feed xmlns="http://www.w3.org/2005/Atom"><title>Matt Makai</title><link href="http://www.fullstackpython.com/" rel="alternate"></link><link href="http://www.fullstackpython.com/feeds/all.atom.xml" rel="self"></link><id>http://www.fullstackpython.com/</id><updated>2015-02-15T11:36:50Z</updated></feed>
2+
<feed xmlns="http://www.w3.org/2005/Atom"><title>Matt Makai</title><link href="http://www.fullstackpython.com/" rel="alternate"></link><link href="http://www.fullstackpython.com/feeds/all.atom.xml" rel="self"></link><id>http://www.fullstackpython.com/</id><updated>2015-02-15T11:54:27Z</updated></feed>

flask.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ <h3 class="panel-head">Sponsored By</h3>
338338
<a href="https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=flask_page"><img src="theme/img/sponsored/realpython.png" alt="Real Python logo" width="100%"></a>
339339
<p style="font-size: .8em;">If you're searching for step-by-step Flask
340340
tutorials then I highly recommend
341-
<a href="https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=flask_page">checking out Real Python</a>.
341+
<a href="https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=flask_page" onclick="trackOutboundLink('https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=flask_page'); return false;">checking out Real Python</a>.
342342
</p>
343343
</div>
344344
</div>
@@ -421,5 +421,6 @@ <h3 class="panel-head"><a href="/table-of-contents.html" style="color: #fff;">Ta
421421
</div>
422422
<link href="theme/css/f.min.css" rel="stylesheet">
423423
<link href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.css" rel="stylesheet">
424+
<script type="text/javascript" src="theme/js/track_out.js"></script>
424425
</body>
425426
</html>

source/content/pages/02-learning-python/04-best-python-resources.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ should skip down to the next section for "experienced developers".
3535

3636
* To get an introduction to Python, Django and Flask at the same time,
3737
consider purchasing the
38-
[Real Python](http://www.realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=best_resources_page) course by Fletcher, Michael and
39-
Jeremy.
38+
<a href="http://www.realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=best_resources_page" onclick="trackOutboundLink('http://www.realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=best_resources_page'); return false;">Real Python</a>
39+
course by Fletcher, Michael and Jeremy.
4040

4141
* If you've never programmed before check out the
4242
[Getting Started](http://learntocodewith.me/getting-started/) page on
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<script>
2+
/**
3+
* Function that tracks a click on an outbound link in Google Analytics.
4+
* This function takes a valid URL string as an argument, and uses that URL string
5+
* as the event label.
6+
*/
7+
var trackOutboundLink = function(url) {
8+
ga('send', 'event', 'outbound', 'click', url, {'hitCallback':
9+
function () {
10+
document.location = url;
11+
}
12+
});
13+
}
14+
</script>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{% if page.title == 'Django' or page.title == 'Flask' or page.title == 'Best Python Resources' or page.title == 'Web Frameworks' %}
2+
<script type="text/javascript" src="theme/js/track_out.js"></script>
3+
{% endif %}

source/theme/templates/page.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@
1919
{% if page.title == 'Django' %}
2020
{% include "crazyegg.html" %}
2121
{% endif %}
22+
{% include "outbound.html" %}
2223
{% endblock %}

source/theme/templates/sponsor.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ <h3 class="panel-head">Sponsored By</h3>
77
<a href="https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=django_page"><img src="theme/img/sponsored/realpython.png" alt="Real Python logo" width="100%"></a>
88
<p style="font-size: .8em;">If you're searching for step-by-step Django
99
tutorials then I highly recommend
10-
<a href="https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=django_page">checking out Real Python</a>.
10+
<a href="https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=django_page" onclick="trackOutboundLink('https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=django_page'); return false;">checking out Real Python</a>.
1111
</p>
1212
</div>
1313
</div>
@@ -22,7 +22,7 @@ <h3 class="panel-head">Sponsored By</h3>
2222
<a href="https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=flask_page"><img src="theme/img/sponsored/realpython.png" alt="Real Python logo" width="100%"></a>
2323
<p style="font-size: .8em;">If you're searching for step-by-step Flask
2424
tutorials then I highly recommend
25-
<a href="https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=flask_page">checking out Real Python</a>.
25+
<a href="https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=flask_page" onclick="trackOutboundLink('https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=flask_page'); return false;">checking out Real Python</a>.
2626
</p>
2727
</div>
2828
</div>
@@ -38,7 +38,7 @@ <h3 class="panel-head">Sponsored By</h3>
3838
<a href="https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=best_resources_page"><img src="theme/img/sponsored/realpython.png" alt="Real Python logo" width="100%"></a>
3939
<p style="font-size: .8em;">If you want to learn Python then
4040
I highly recommend
41-
<a href="https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=best_python_resources">checking out Real Python</a>'s
41+
<a href="https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=best_python_resources" onclick="trackOutboundLink('https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=best_resources_page'); return false;">checking out Real Python</a>'s
4242
courses.
4343
</p>
4444
</div>
@@ -54,7 +54,7 @@ <h3 class="panel-head">Sponsored By</h3>
5454
<a href="https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=web_frameworks_page"><img src="theme/img/sponsored/realpython.png" alt="Real Python logo" width="100%"></a>
5555
<p style="font-size: .8em;">If you want to learn Python web development then
5656
I highly recommend
57-
<a href="https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=best_python_resources">checking out Real Python</a>'s
57+
<a href="https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=web_frameworks_page" onclick="trackOutboundLink('https://realpython.com/?utm_source=fullstackpython&utm_medium=referral&utm_campaign=web_frameworks_page'); return false;">checking out Real Python</a>'s
5858
courses.
5959
</p>
6060
</div>

0 commit comments

Comments
 (0)