Skip to content

Commit

Permalink
Support for openpanel.dev for analytics (#2822)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaitguenissaid authored Nov 10, 2024
1 parent 587f03a commit b7ee266
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ contact_note: >
google_analytics: # your Google Analytics measurement ID (format: G-XXXXXXXXXX)
cronitor_analytics: # cronitor RUM analytics site ID (format: XXXXXXXXX)
pirsch_analytics: # your Pirsch analytics site ID (length 32 characters)
openpanel_analytics: # your Openpanel analytics client ID (format: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX)

# For Google Search Console, see https://support.google.com/webmasters/answer/9008080?hl=en#meta_tag_verification&zippy=%2Chtml-tag
google_site_verification: # your google-site-verification ID (Google Search Console)
Expand Down Expand Up @@ -428,6 +429,7 @@ lazy_loading_images: true # enables lazy loading of images (recommended)
enable_google_analytics: false # enables google analytics
enable_cronitor_analytics: false # enables cronitor RUM analytics
enable_pirsch_analytics: false # enables Pirsch analytics (https://pirsch.io/)
enable_openpanel_analytics: false # enables Openpanel analytics (https://openpanel.dev/)
enable_google_verification: false # enables google site verification
enable_bing_verification: false # enables bing site verification
enable_masonry: true # enables automatic project cards arrangement
Expand Down
16 changes: 16 additions & 0 deletions _includes/scripts/analytics.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,19 @@
data-code="{{ site.pirsch_analytics }}"
></script>
{% endif %}
{% if site.enable_openpanel_analytics %}
<script>
window.op =
window.op ||
function (...args) {
(window.op.q = window.op.q || []).push(args);
};
window.op('init', {
clientId: '{{ site.openpanel_analytics }}',
trackScreenViews: true,
trackOutgoingLinks: true,
trackAttributes: true,
});
</script>
<script src="https://openpanel.dev/op1.js" defer async></script>
{% endif %}

0 comments on commit b7ee266

Please sign in to comment.