Skip to content
This repository was archived by the owner on Feb 5, 2022. It is now read-only.

Commit 95a00b4

Browse files
authored
Merge pull request #372 from openforge/google-analytics-events
Google analytics events
2 parents 2157057 + e32f5fe commit 95a00b4

File tree

20 files changed

+22
-125
lines changed

20 files changed

+22
-125
lines changed

src/components/app-blog-card/app-blog-card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class AppBlogCard {
2727
</div>
2828
<div class="blog-title">
2929
<stencil-route-link url={`/blog/${this.blogPost.slug}`}>
30-
<h2>{this.blogPost.title}</h2>
30+
<h2 id="blog-title">{this.blogPost.title}</h2>
3131
</stencil-route-link>
3232
</div>
3333
<div class="author">

src/components/app-blog-featured/app-blog-featured.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class AppBlogFeatured {
3535
</div>
3636
<div class="featured-post-title">
3737
<stencil-route-link url={`/blog/${this.blogPost.slug}`}>
38-
<h2>{this.blogPost.title}</h2>
38+
<h2 id="featured-blog-title">{this.blogPost.title}</h2>
3939
</stencil-route-link>
4040
</div>
4141
<div class="author">

src/components/app-footer/app-footer.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,22 @@ export class AppFooter {
4141
<h2>{translate('footer.social.followUs')}</h2>
4242
<ul class="footer--social-links">
4343
<li>
44-
<a href="https://twitter.com/OpenForge_US" target="_blank" rel="noopener">
44+
<a href="https://twitter.com/OpenForge_US" id="twitter" target="_blank" rel="noopener">
4545
<i class="fab fa-twitter-square" aria-hidden="true" /> {translate('footer.social.twitter')}
4646
</a>
4747
</li>
4848
<li>
49-
<a href="https://www.facebook.com/OpenForgeUS/" target="_blank" rel="noopener">
49+
<a href="https://www.facebook.com/OpenForgeUS/" id="facebook" target="_blank" rel="noopener">
5050
<i class="fab fa-facebook-square" aria-hidden="true" /> {translate('footer.social.facebook')}
5151
</a>
5252
</li>
5353
<li>
54-
<a href="https://www.linkedin.com/company/openforge/" target="_blank" rel="noopener">
54+
<a href="https://www.linkedin.com/company/openforge/" id="linkedin" target="_blank" rel="noopener">
5555
<i class="fab fa-linkedin" aria-hidden="true" /> {translate('footer.social.linkedin')}
5656
</a>
5757
</li>
5858
<li>
59-
<a href="https://www.instagram.com/openforgeteam/" target="_blank" rel="noopener">
59+
<a href="https://www.instagram.com/openforgeteam/" id="instagram" target="_blank" rel="noopener">
6060
<i class="fab fa-instagram" aria-hidden="true" /> {translate('footer.social.instagram')}
6161
</a>
6262
</li>
@@ -68,7 +68,7 @@ export class AppFooter {
6868
<div class="footer--column col-12 col-sm-4">
6969
<h2>{translate('footer.webinar.signup')}</h2>
7070
<p>{translate('footer.webinar.webinarText')}</p>
71-
<a href="http://startupjunto.org/" target="_blank" rel="noopener" class="footer--btn btn btn-primary">
71+
<a href="http://startupjunto.org/" target="_blank" id="startup-junto meetup" rel="noopener" class="footer--btn btn btn-primary">
7272
{translate('footer.webinar.register')}
7373
</a>
7474
</div>

src/components/app-nav-header/app-nav-header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export class AppNavHeader {
106106
</stencil-route-link>
107107
</li>
108108
<li class="nav-item" data-target="#navbarSupportedContent">
109-
<a class="nav-link" href="https://github.com/openforge" title={translate('nav.links.github')} target="_blank" rel="noopener">
109+
<a class="nav-link" id="github" href="https://github.com/openforge" title={translate('nav.links.github')} target="_blank" rel="noopener">
110110
<div class="fab fa-github" />
111111
</a>
112112
</li>

src/index.html

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
<!-- Preload to increase Time to Interactive -->
2424

25-
2625
<link rel="apple-touch-icon" href="/assets/icon/icon.png">
2726
<link rel="icon" type="image/x-icon" href="/assets/icon/favicon.ico">
2827
<link rel="manifest" href="/manifest.json">
@@ -35,30 +34,13 @@
3534
<!-- In case JavaScript is not available -->
3635
<noscript>Your browser does not support JavaScript!</noscript>
3736

38-
<!-- Structured Data -->
39-
<!-- <script type="application/ld+json">
40-
{
41-
"@context": "http://schema.org",
42-
"@type": "Organization",
43-
"url": "http://www.openforge.io/",
44-
"name": "OpenForge",
45-
"address": "1040 N 2nd St, Suite #301, Philadelphia, PA 19123"
46-
};
47-
</script> -->
48-
49-
<!-- Global Site Tag (gtag.js) - Google Analytics -->
50-
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-118169306-1"></script>
51-
<script>
52-
window.dataLayer = window.dataLayer || [];
53-
54-
function gtag() {
55-
dataLayer.push(arguments);
56-
}
57-
gtag('js', new Date());
58-
59-
gtag('config', 'UA-118169306-1');
60-
61-
</script>
37+
<!-- Google Tag Manager -->
38+
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
39+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
40+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
41+
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
42+
})(window,document,'script','dataLayer','GTM-KFPQ95V');</script>
43+
<!-- End Google Tag Manager -->
6244

6345
<script>
6446
console.log("Verifying user is on latest browser");
@@ -114,6 +96,11 @@
11496
</head>
11597

11698
<body>
99+
<!-- Google Tag Manager (noscript) -->
100+
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KFPQ95V"
101+
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
102+
<!-- End Google Tag Manager (noscript) -->
103+
117104
<app-nav-header />
118105

119106
<open-forge-app></open-forge-app>

src/pages/app-about/app-about.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { Component, Prop } from '@stencil/core';
22
import { translate } from '../../services/translation.service';
33

44
declare var fbq;
5-
declare var gtag;
65

76
@Component({
87
tag: 'app-about',
@@ -198,10 +197,6 @@ export class AppAbout {
198197
];
199198

200199
componentDidLoad() {
201-
gtag('config', 'UA-118169306-1', {
202-
page_title: document.title,
203-
page_path: window.location.pathname,
204-
});
205200
// isServer is false when running in the browser
206201
// and true when being prerendered
207202
if (!this.isServer) {

src/pages/app-blog-index/app-blog-index.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Component, Prop, State } from '@stencil/core';
22
import { BLOG_DATA } from '../app-blog-post/prerender-blog-data';
3-
declare var gtag;
43

54
@Component({
65
tag: 'app-blog-index',
@@ -12,11 +11,6 @@ export class AppBlogIndex {
1211
@Prop({ context: 'isServer' }) private isServer;
1312

1413
componentWillLoad() {
15-
gtag('config', 'UA-118169306-1', {
16-
page_title: document.title,
17-
page_path: window.location.pathname,
18-
});
19-
2014
if (this.isServer) {
2115
this.blogData = BLOG_DATA.data;
2216
} else {

src/pages/app-blog-post/app-blog-post.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { Component, Prop, State, Watch } from '@stencil/core';
22
import { RouterHistory, MatchResults } from '@stencil/router';
33
import { BlogPost } from '../../model/blog-post.model';
44
import { BLOG_DATA } from './prerender-blog-data';
5-
declare var gtag;
65

76
@Component({
87
tag: 'app-blog-post',
@@ -35,11 +34,6 @@ export class AppBlogPost {
3534
}
3635

3736
componentWillLoad() {
38-
gtag('config', 'UA-118169306-1', {
39-
page_title: document.title,
40-
page_path: window.location.pathname,
41-
});
42-
4337
this.getPostContent();
4438

4539
// get a bunch of blog posts and pick 3 to display in read next

src/pages/app-blog/app-blog.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { BlogMeta } from '../../model/blog-meta.model';
44
import { BlogCategory } from '../../model/blog-category.model';
55

66
declare var fbq;
7-
declare var gtag;
87

98
@Component({
109
tag: 'app-blog',
@@ -68,10 +67,6 @@ export class AppBlog {
6867
}
6968

7069
componentDidLoad() {
71-
gtag('config', 'UA-118169306-1', {
72-
page_title: document.title,
73-
page_path: window.location.pathname,
74-
});
7570
// isServer is false when running in the browser
7671
// and true when being prerendered
7772
if (!this.isServer) {

src/pages/app-case-study/app-case-study.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Component } from '@stencil/core';
2-
declare var gtag;
32

43
@Component({
54
tag: 'app-case-study',
@@ -14,11 +13,6 @@ export class AppCaseStudy {
1413
}
1514

1615
componentDidLoad() {
17-
gtag('config', 'UA-118169306-1', {
18-
page_title: document.title,
19-
page_path: window.location.pathname,
20-
});
21-
2216
document.querySelector("meta[property='og:title']").setAttribute('content', 'JuntoScope - Scoping Software | OpenForge');
2317
document
2418
.querySelector("meta[property='og:description']")

0 commit comments

Comments
 (0)