Skip to content

Commit 4803847

Browse files
committed
update customData with <meta> contents
1 parent 76d4756 commit 4803847

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/partials/head-last.hbs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,16 @@
99
{{/if}}
1010

1111
<script>
12+
// return all meta items as customData
13+
const customData =
14+
Object.fromEntries(
15+
Array.from(document.querySelectorAll('meta[name]')).map(
16+
a => [a.name, a.content]))
17+
1218
window.markerConfig = {
1319
project: '6911fff96c3b61c1fb3a0678',
14-
source: 'snippet'
20+
source: 'snippet',
21+
customData
1522
};
1623
1724
!function(e,r,a){if(!e.__Marker){e.__Marker={};var t=[],n={__cs:t};["show","hide","isVisible","capture","cancelCapture","unload","reload","isExtensionInstalled","setReporter","clearReporter","setCustomData","on","off"].forEach(function(e){n[e]=function(){var r=Array.prototype.slice.call(arguments);r.unshift(e),t.push(r)}}),e.Marker=n;var s=r.createElement("script");s.async=1,s.src="https://edge.marker.io/latest/shim.js";var i=r.getElementsByTagName("script")[0];i.parentNode.insertBefore(s,i)}}(window,document);

0 commit comments

Comments
 (0)