Try to deactivate it before you delete it. I was able to see the injected code disappear from the HTML source when I deactivated it. Also, clear your performance cache if you have one installed.
I was able to work around it by putting this into header.php for both themes.
<!-- Split test -->
<script>
ga('set', 'dimension1', '<?= wp_get_theme()->get('Name') ?>');
</script>
</head>
Google also seems to have renamed their custom variables, and now it’s called something else.
https://support.google.com/analytics/answer/2709829