Skip to content

Commit 3ae39be

Browse files
authored
Making Downloads Trackable (see #1141) (#1148)
Updated version of PR #1141, adds a global JS helper: Links with the attribute `data-casestudy` will be tracked automatically, using the value of the data attribute as title in Google Analytics.
1 parent b849ca3 commit 3ae39be

2 files changed

Lines changed: 19 additions & 5 deletions

File tree

layouts/partials/footer.hbs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,21 @@
5858
s=o.getElementsByTagName(e)[0];j.async=1;j.src='//www.google-analytics.com/analytics.js';
5959
s.parentNode.insertBefore(j,s)}(window,document,'ga','script');
6060
61+
if (!ga) return;
62+
6163
ga('create', 'UA-67020396-1', 'auto');
6264
ga('send', 'pageview');
65+
66+
document.documentElement.addEventListener('click', function(e) {
67+
68+
// Track case studies
69+
if(!e.target || !e.target.dataset || !e.target.dataset.casestudy) return;
70+
ga('send', 'event', {
71+
eventCategory: 'casestudy',
72+
eventAction: 'click',
73+
eventLabel: e.target.dataset.casestudy,
74+
eventValue: 0
75+
});
76+
});
6377
}
6478
</script>

locale/en/foundation/case-studies.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ preferences (current and future) for front end, back end and IoT developers.
1616

1717
* [Read the full announcement.](/en/blog/announcements/nodejs-foundation-survey/)
1818
* [See the infographic.](/static/documents/2016-survey-infographic.png)
19-
* [Read the full report.](/static/documents/2016-survey-report.pdf)
19+
* <a href="/static/documents/2016-survey-report.pdf" data-casestudy="Node.js 2016 Report">Read the full report.</a>
2020

2121
## Presentation - The Enterprise Case for Node.js
2222
The Node.js Foundation has consolidated all the best thinking around why enterprises should consider Node.js for their systems of engagement in this short presentation.
@@ -27,21 +27,21 @@ The Node.js Foundation has consolidated all the best thinking around why enterpr
2727

2828
Walmart sees nearly 20,000 hits per-second on its website and mobile app during the holiday season, so it needs a fast, reliable and bulletproof ecommerce system to reach its goal of becoming the number one online retailer. That’s why it’s rebuilding Walmart.com with Node.js.
2929

30-
<a href="/static/documents/casestudies/Node_CaseStudy_Walmart_final.pdf" onClick="ga('send', 'event', { eventCategory: 'casestudy', eventAction: 'click', eventLabel: 'Walmart Case Study', eventValue: 0});" target="blank">Read the full case study.</a>
30+
<a href="/static/documents/casestudies/Node_CaseStudy_Walmart_final.pdf" data-casestudy="Walmart Case Study">Read the full case study.</a>
3131

3232
## Node.js Helps NASA Keep Astronauts Safe and Data Accessible
3333

3434
Collin Estes is the Director of Software Engineering and Chief Architect at Mathematical Research Institute Technologies (MRI Technologies), who partners with United Technologies Corporation Aerospace Systems, the company that creates and maintains the spacesuits for extra vehicular activity (EVA) missions at NASA. He and his team took on the challenge of creating an end-to-end system for data on the full lifecycle of spacesuits. He chose Node.js to make it work.
3535

36-
[Read the full case study.](/static/documents/casestudies/Node_CaseStudy_Nasa_FNL.pdf)
36+
<a href="/static/documents/casestudies/Node_CaseStudy_Nasa_FNL.pdf" data-casestudy="NASA case study">Read the full case study.</a>
3737

3838
## Node.js Drives Major Scale and Reliability at Uber
3939

4040
The ride-sharing platform Uber has an ambitious goal: to make transportation
4141
as reliable as running water, everywhere and for everyone. Learn why Uber
4242
chose Node.js to power its platform and massive-matching system.
4343

44-
[Read the full case study.](/static/documents/casestudies/Nodejs-at-Uber.pdf)
44+
<a href="/static/documents/casestudies/Nodejs-at-Uber.pdf" data-casestudy="Uber">Read the full case study.</a>
4545

4646
## Node.js Helps Fusion Marketing Build Memorable Digital Experiences
4747

@@ -50,7 +50,7 @@ in creating custom interactive experiences. Node.js Everywhere has powered
5050
Fusion's digital expansion from developing app APIs to a 360 degree physical
5151
interactive group.
5252

53-
[Read the full case study.](/static/documents/casestudies/Node_CaseStudy_Fusion_Final.pdf)
53+
<a href="/static/documents/casestudies/Node_CaseStudy_Fusion_Final.pdf" data-casestudy="Fusion Marketing">Read the full case study.</a>
5454

5555
# Enterprise Conversations
5656

0 commit comments

Comments
 (0)