<commit_before><script>

    {{!-- Add title to dataLayer. Dont include the edition on dataset versions pages --}}
    var dataLayer = [{
        contentTitle: "{{> partials/page-title}}{{#if_all (if description.edition) (ne description.edition "current")}}: {{description.edition}}{{/if_all}}"
    }];

    {{#if description.releaseDate}}
    dataLayer[0]["releaseDate"] = "{{df description.releaseDate outputFormat='yyyy/MM/dd'}}";
    {{/if}}

    {{#if result.numberOfResults}}
    dataLayer[0]["numberOfResults"] = {{result.numberOfResults}};
    {{/if}}

    {{!-- Add the related publication into the Google Tag Manager data layer object --}}
    {{#if_any (eq type "dataset_landing_page") (eq type "timeseries")}}
        dataLayer[0]["publications"] = [];
        {{#if relatedDocuments}}
            {{#each relatedDocuments}}
                {{#resolve this.uri filter="title"}}
                    dataLayer[0].publications.push({
                        title: "{{title}}{{#if edition}}: {{edition}}{{/if}}",
                        uri: "{{uri}}"
                    });
                {{/resolve}}
            {{/each}}
        {{/if}}
    {{/if_any}}


    {{!-- Add latest release info to dataLayer --}}
    {{#if_any (eq type "bulletin") (eq type "article") (eq type "compendium_landing_page") (eq type "compendium_chapter")}}
        {{#unless (endsWith (parentPath uri) "previous")}}
            {{#if description.latestRelease}}
                dataLayer[0]["latestRelease"] = "yes";
            {{else}}
                dataLayer[0]["latestRelease"] = "no";
            {{/if}}
        {{else}}
            dataLayer[0]["latestRelease"] = "no";
        {{/unless}}
    {{/if_any}}


    {{!-- Update Google Tag Manager data layer with information about corrections and notices --}}
    {{#if alerts}}
        {{#each alerts}}
            {{#if_eq type "correction"}}
                {{#assign "has-corrections"}}
                true
                {{/assign}}
            {{/if_eq}}

            {{#if_eq type "alert"}}
                {{#assign "has-alerts"}}
                true
                {{/assign}}
            {{/if_eq}}
        {{/each}}

        {{#if has-corrections}}
            dataLayer[0]["corrections"] = "yes";
        {{else}}
            dataLayer[0]["corrections"] = "no";
        {{/if}}
        {{#if has-alerts}}
            dataLayer[0]["notices"] = "yes";
        {{else}}
            dataLayer[0]["notices"] = "no";
        {{/if}}

    {{/if}}

    {{#if versions}}
        {{#each versions}}
            {{#if correctionNotice}}
                {{#assign "has-corrections"}}
                true
                {{/assign}}
            {{/if}}
        {{/each}}

        {{#if has-corrections}}
            dataLayer[0]["corrections"] = "yes";
        {{else}}
            dataLayer[0]["corrections"] = "no";
        {{/if}}<commit_msg>Prevent corrections being added into dataLayer on dataset pages<commit_after><script>

    {{!-- Add title to dataLayer. Dont include the edition on dataset versions pages --}}
    var dataLayer = [{
        contentTitle: "{{> partials/page-title}}{{#if_all (if description.edition) (ne description.edition "current")}}: {{description.edition}}{{/if_all}}"
    }];

    {{#if description.releaseDate}}
    dataLayer[0]["releaseDate"] = "{{df description.releaseDate outputFormat='yyyy/MM/dd'}}";
    {{/if}}

    {{#if result.numberOfResults}}
    dataLayer[0]["numberOfResults"] = {{result.numberOfResults}};
    {{/if}}

    {{!-- Add the related publication into the Google Tag Manager data layer object --}}
    {{#if_any (eq type "dataset_landing_page") (eq type "timeseries")}}
        dataLayer[0]["publications"] = [];
        {{#if relatedDocuments}}
            {{#each relatedDocuments}}
                {{#resolve this.uri filter="title"}}
                    dataLayer[0].publications.push({
                        title: "{{title}}{{#if edition}}: {{edition}}{{/if}}",
                        uri: "{{uri}}"
                    });
                {{/resolve}}
            {{/each}}
        {{/if}}
    {{/if_any}}


    {{!-- Add latest release info to dataLayer --}}
    {{#if_any (eq type "bulletin") (eq type "article") (eq type "compendium_landing_page") (eq type "compendium_chapter")}}
        {{#unless (endsWith (parentPath uri) "previous")}}
            {{#if description.latestRelease}}
                dataLayer[0]["latestRelease"] = "yes";
            {{else}}
                dataLayer[0]["latestRelease"] = "no";
            {{/if}}
        {{else}}
            dataLayer[0]["latestRelease"] = "no";
        {{/unless}}
    {{/if_any}}


    {{!-- Update Google Tag Manager data layer with information about corrections and notices --}}
    {{#if alerts}}
        {{#each alerts}}
            {{#if_eq type "correction"}}
                {{#assign "has-corrections"}}
                true
                {{/assign}}
            {{/if_eq}}

            {{#if_eq type "alert"}}
                {{#assign "has-alerts"}}
                true
                {{/assign}}
            {{/if_eq}}
        {{/each}}

        {{#if_ne type "dataset"}}
            {{#if has-corrections}}
                dataLayer[0]["corrections"] = "yes";
            {{else}}
                dataLayer[0]["corrections"] = "no";
            {{/if}}
            {{#if has-alerts}}
                dataLayer[0]["notices"] = "yes";
            {{else}}
                dataLayer[0]["notices"] = "no";
            {{/if}}
        {{/if_ne}}

    {{/if}}

    {{#if versions}}
        {{#each versions}}
            {{#if correctionNotice}}
                {{#assign "has-corrections"}}
                true
                {{/assign}}
            {{/if}}
        {{/each}}

        {{#if_ne type "dataset"}}
            {{#if has-corrections}}
                dataLayer[0]["corrections"] = "yes";
            {{else}}
                dataLayer[0]["corrections"] = "no";
            {{/if}}
        {{/if_ne}}
{'fraction_non_alphanumeric': 0.18454363757495004, 'fraction_numerical': 0.0043304463690872754, 'mean_word_length': 1.7736720554272518, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '1089320', 'n_tokens_mistral': 1813, 'n_tokens_neox': 1710, 'n_words': 375}