Skip to content

Commit 26a0b9d

Browse files
author
Peter Panagiotakos
committed
add marketo pixel
1 parent c3f2330 commit 26a0b9d

File tree

2 files changed

+30
-3
lines changed

2 files changed

+30
-3
lines changed

layouts/_footer.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,4 @@
1111
<% end %>
1212

1313
<%= snowplow_pixel() %>
14-
15-
16-
14+
<%= munchkin() %>

lib/default.rb

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,32 @@ def snowplow_pixel()
116116

117117
return html
118118
end
119+
120+
def munchkin()
121+
html = <<-EOF
122+
<script type="text/javascript">
123+
(function() {
124+
var didInit = false;
125+
function initMunchkin() {
126+
if(didInit === false) {
127+
didInit = true;
128+
Munchkin.init('875-UVY-685');
129+
}
130+
}
131+
var s = document.createElement('script');
132+
s.type = 'text/javascript';
133+
s.async = true;
134+
s.src = '//munchkin.marketo.net/munchkin.js';
135+
s.onreadystatechange = function() {
136+
if (this.readyState == 'complete' || this.readyState == 'loaded') {
137+
initMunchkin();
138+
}
139+
};
140+
s.onload = initMunchkin;
141+
document.getElementsByTagName('head')[0].appendChild(s);
142+
})();
143+
</script>
144+
EOF
145+
146+
return html
147+
end

0 commit comments

Comments
 (0)