Skip to content

Commit 23af9d7

Browse files
DOC-3988: Add conditional tracking pixel (#100)
* Add conditional tracking pixel * hide tracking pixel * update naming conventions
1 parent e7da036 commit 23af9d7

File tree

7 files changed

+20
-15
lines changed

7 files changed

+20
-15
lines changed

gcx/styles/src/layouts/404.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,5 +184,6 @@ window.addEventListener('DOMContentLoaded', (event) => {
184184
</script>
185185
{{> footer-content}}
186186
{{> intercom}}
187+
{{> tracking-pixel}}
187188
</body>
188189
</html>

gcx/styles/src/layouts/default.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
{{> body}}
99
{{> footer}}
1010
{{> intercom}}
11+
{{> tracking-pixel}}
1112
</body>
1213
</html>

gcx/styles/src/layouts/gcx-full.hbs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
3+
<head>
44
{{> head defaultPageTitle='Untitled'}}
55
</head>
66
<body class="article{{#with (or page.attributes.role page.role)}} {{{this}}}{{/with}}">
@@ -15,15 +15,15 @@
1515
{{> article-404}}
1616
{{else}}
1717
<!--{{> toc}}-->
18-
<script id="antora-main-block" type="text/html">
18+
<script id="antora-main-block" type="text/html">
1919
{{> article}}
20-
</script>
20+
</script>
2121
<gcx-full template-script="antora-main-block" ></gcx-full>
2222
{{/if}}
2323
</div>
2424
</main>
2525

26-
<script>
26+
<script>
2727
let schemaScript = document.querySelector("#antora-main-block").innerHTML;
2828
var htmlObject = document.createElement('div');
2929
htmlObject.innerHTML = schemaScript;
@@ -41,8 +41,8 @@
4141
}
4242
</script>
4343
</div>
44-
{{> footer}}
45-
44+
{{> footer}}
4645
{{> intercom}}
46+
{{> tracking-pixel}}
4747
</body>
4848
</html>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<!DOCTYPE html>
22
<html lang="en" data-template="landing">
33
<head>
4-
4+
55
{{> head defaultPageTitle='Untitled'}}
66
</head>
77
<body class="article{{#with (or page.attributes.role page.role)}} {{{this}}}{{/with}}">
88
{{> header}}
99
{{> body}}
1010
{{> footer}}
11-
1211
{{> intercom}}
12+
{{> tracking-pixel}}
1313
</body>
1414
</html>
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
4+
55
{{> head defaultPageTitle='Untitled'}}
66
</head>
77
<body class="article{{#with (or page.attributes.role page.role)}} {{{this}}}{{/with}}">
88
{{> header}}
9-
<div class="body">
9+
<div class="body">
1010
<main class="article">
1111
{{> toolbar}}
1212
<div class="content">
1313
{{#if (eq page.layout '404')}}
1414
{{> article-404}}
15-
{{else}}
16-
{{> article}}
15+
{{else}}
16+
{{> article}}
1717
{{/if}}
1818
</div>
19-
</main>
19+
</main>
2020
</div>
2121
{{> footer}}
22-
2322
{{> intercom}}
23+
{{> tracking-pixel}}
2424
</body>
2525
</html>

gcx/styles/src/partials/intercom.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ window.intercomSettings = {
66
</script>
77
<script>
88
!function(){var t=window,e=t.Intercom;if("function"==typeof e)e("reattach_activator"),e("update",t.intercomSettings);else{var n=document,a=function(){a.c(arguments)};a.q=[],a.c=function(t){a.q.push(t)},t.Intercom=a;var c=function(){var t=n.createElement("script");t.type="text/javascript",t.async=!0,t.src="https://widget.intercom.io/widget/bpbxnnmr";var e=n.getElementsByTagName("script")[0];e.parentNode.insertBefore(t,e)};t.attachEvent?t.attachEvent("onload",c):t.addEventListener("load",c,!1)}}();
9-
</script>
9+
</script>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{#with site.keys.scarfTrackingPixel}}
2+
<img referrerpolicy="no-referrer-when-downgrade" src="https://static.scarf.sh/a.png?x-pxid={{this}}" style="display:none" />
3+
{{/with}}

0 commit comments

Comments
 (0)