Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-bryson committed Jun 28, 2024
1 parent bd1065d commit 391ee8d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions ckanext/datagovtheme/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{{ super() }}
{% block googleanalytics_custom_gtag %}
{% include '/snippets/gtm/gtm_head.html' %}
{% include '/snippets/gtm/gtm_datalayer.html' %}
{% endblock %}
{% block open_graph_previews %}
{% include '/snippets/link_preview.html' %}
Expand Down
24 changes: 24 additions & 0 deletions ckanext/datagovtheme/templates/snippets/gtm/gtm_datalayer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

{% set pkg = c.pkg_dict %}
{% if pkg %}

{% block gtmdatalayer %}
{% set dataset = pkg.title or pkg.name or "Data.gov Dataset" %}
{% set organization = pkg.organization.title or pkg.organization.name or "error-org" %}
{% set publisher = pkg.extras.publisher or pkg.organization.name or "error-publsiher" %}
{% set language = pkg.extras.language or "en" %}

<script type="application/ld+json" class="jsonld-dataset">
dataLayer = [{
'nodeID':, {% pkg.id %},
'contentType": 'dataset',
'language': {% language %},
'homepageTest': "not_homepage",
"basicPagesubType": "dataset",
"Page_Type": "Dataset Page",
"organization": {% organization %},
"publisher": {% publisher %},
}];
</script>
{% endblock %}
{% endif %}

0 comments on commit 391ee8d

Please sign in to comment.