chore!: remove mixpanel code (#21112)

This commit is contained in:
Ankush Menat 2023-05-25 17:10:43 +05:30 committed by GitHub
parent 284df60076
commit 1eabd21bb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 0 additions and 21 deletions

View file

@ -38,7 +38,6 @@ frappe.Application = class Application {
this.load_user_permissions();
this.make_nav_bar();
this.set_favicon();
this.setup_analytics();
this.set_fullwidth_if_enabled();
this.add_browser_class();
this.setup_energy_point_listeners();
@ -512,18 +511,6 @@ frappe.Application = class Application {
});
}
setup_analytics() {
if (window.mixpanel) {
window.mixpanel.identify(frappe.session.user);
window.mixpanel.people.set({
$first_name: frappe.boot.user.first_name,
$last_name: frappe.boot.user.last_name,
$created: frappe.boot.user.creation,
$email: frappe.session.user,
});
}
}
add_browser_class() {
$("html").addClass(frappe.utils.get_browser().name.toLowerCase());
}

View file

@ -1,6 +0,0 @@
{% if mixpanel_id %}
<!-- start Mixpanel --><script type="text/javascript">(function(e,a){if(!a.__SV){var b=window;try{var c,l,i,j=b.location,g=j.hash;c=function(a,b){return(l=a.match(RegExp(b+"=([^&]*)")))?l[1]:null};g&&c(g,"state")&&(i=JSON.parse(decodeURIComponent(c(g,"state"))),"mpeditor"===i.action&&(b.sessionStorage.setItem("_mpcehash",g),history.replaceState(i.desiredHash||"",e.title,j.pathname+j.search)))}catch(m){}var k,h;window.mixpanel=a;a._i=[];a.init=function(b,c,f){function e(b,a){var c=a.split(".");2==c.length&&(b=b[c[0]],a=c[1]);b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,
0)))}}var d=a;"undefined"!==typeof f?d=a[f]=[]:f="mixpanel";d.people=d.people||[];d.toString=function(b){var a="mixpanel";"mixpanel"!==f&&(a+="."+f);b||(a+=" (stub)");return a};d.people.toString=function(){return d.toString(1)+".people (stub)"};k="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
for(h=0;h<k.length;h++)e(d,k[h]);a._i.push([b,c,f])};a.__SV=1.2;b=e.createElement("script");b.type="text/javascript";b.async=!0;b.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";c=e.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c)}})(document,window.mixpanel||[]);
mixpanel.init("{{ mixpanel_id }}");</script><!-- end Mixpanel -->
{% endif %}

View file

@ -52,7 +52,6 @@
{% endfor %}
{% include "templates/includes/app_analytics/google_analytics.html" %}
{% include "templates/includes/app_analytics/mixpanel_analytics.html" %}
{% for sound in (sounds or []) %}
<audio preload="auto" id="sound-{{ sound.name }}" volume={{ sound.volume or 1 }}>

View file

@ -60,7 +60,6 @@ def get_context(context):
"csrf_token": csrf_token,
"google_analytics_id": frappe.conf.get("google_analytics_id"),
"google_analytics_anonymize_ip": frappe.conf.get("google_analytics_anonymize_ip"),
"mixpanel_id": frappe.conf.get("mixpanel_id"),
"app_name": (
frappe.get_website_settings("app_name") or frappe.get_system_settings("app_name") or "Frappe"
),