<commit_before><?php
class PardotTracker extends SiteTreeExtension
{

    /**
    *gets tracking code based on campaign
    *@return tracking javascript for pardot api
    */
    public static function GetPardotTrackingJs()
    {
        $html = false;
        $campaign = PardotConfig::getCampaignCode();
        
        if ($campaign) {
            $tracker_cache = SS_Cache::factory('Pardot');
            if (!$tracking_code_template = $tracker_cache->load('pardot_tracking_code_template')) {
                $api_credentials = PardotConfig::getPardotCredentials();
                $pardot = new Pardot_API();
                if (!$pardot->is_authenticated()) {
                    $pardot->authenticate($api_credentials);
                }
                
                $account = $pardot->get_account();

                if (isset($account->tracking_code_template)) {
                    $tracking_code_template = $account->tracking_code_template;
                    $tracker_cache->save($tracking_code_template, 'pardot_tracking_code_template');
                }
            }
            $tracking_code_template = str_replace('%%CAMPAIGN_ID%%', $campaign+1000, $tracking_code_template);
            $campaign = $campaign + 1000;
            $html =<<<HTML
<script> type="text/javascript">
piCId = '{$campaign}';
{$tracking_code_template}
</script>
HTML;
        }
        return $html;
    }
}
<commit_msg>BUGFIX: Fixed tracker opening script tag closing early<commit_after><?php
class PardotTracker extends SiteTreeExtension
{

    /**
    *gets tracking code based on campaign
    *@return tracking javascript for pardot api
    */
    public static function GetPardotTrackingJs()
    {
        $html = false;
        $campaign = PardotConfig::getCampaignCode();
        
        if ($campaign) {
            $tracker_cache = SS_Cache::factory('Pardot');
            if (!$tracking_code_template = $tracker_cache->load('pardot_tracking_code_template')) {
                $api_credentials = PardotConfig::getPardotCredentials();
                $pardot = new Pardot_API();
                if (!$pardot->is_authenticated()) {
                    $pardot->authenticate($api_credentials);
                }
                
                $account = $pardot->get_account();

                if (isset($account->tracking_code_template)) {
                    $tracking_code_template = $account->tracking_code_template;
                    $tracker_cache->save($tracking_code_template, 'pardot_tracking_code_template');
                }
            }
            $tracking_code_template = str_replace('%%CAMPAIGN_ID%%', $campaign+1000, $tracking_code_template);
            $campaign = $campaign + 1000;
            $html =<<<HTML
<script type="text/javascript">
piCId = '{$campaign}';
{$tracking_code_template}
</script>
HTML;
        }
        return $html;
    }
}

{'fraction_non_alphanumeric': 0.11666666666666667, 'fraction_numerical': 0.005555555555555556, 'mean_word_length': 2.222595078299776, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4189280', 'n_tokens_mistral': 871, 'n_tokens_neox': 785, 'n_words': 139}