Guidance on using the Discover Uni widget

This information is provided as part of Department for Education (DfE) guidance for providers regarding transparency in advertising to ensure that any potential applicant is aware of the official data that Discover Uni provides and has the opportunity to use the data to inform their decision making.

The Discover Uni widget is the recommended means of signposting to the Discover Uni course page in online advertising and marketing, as it takes applicants directly to the relevant and up to date data.

A widget should be used for advertising or marketing of any course that appears on the Discover Uni website.

It should currently be displayed clearly on every course page on all university and college websites where a course is advertised and appears on the Discover Uni website. This includes courses where there is no data available for any of the data items displayed on the widget, as it will enable users to link to the corresponding record on Discover Uni where other course data will be displayed.

Under the DfE transparency in advertising guidance, other online marketing or advertising of any courses, such as on third party websites, should also use the widget where possible.

About the widget

The Discover Uni widget is a small web application that displays the Discover Uni (Unistats) course data. It can be embedded within web pages. 

The widget displays data from the corresponding course on the Discover Uni website. When a user clicks on the widget, they are taken to the course record on Discover Uni where they can access all the information about that course.

The course data is updated weekly to reflect any minor changes to course data and then annually in the autumn with the publication on the latest dataset.  Existing widgets on provider or other web pages will automatically update to display the latest dataset and any associated changes.

The data currently displayed on the widget

The widget currently displays up to three data items if they are available for a course. These are:

  • The percentage of students in the National Student Survey that agreed they were overall satisfied.
  • The percentage of students in the National Student Survey that agreed that staff were good at explaining things.
  • The percentage of students in work or further study after 15 months from the Graduate Outcomes survey.

If the course has multiple subjects associated with it, which would result in multiple instances of each data item, data will not be displayed on the widget. Instead, the name of the course will be displayed, and users can click on the widget to go to the Discover Uni course page to see the full set of data available for the course. Please see examples given below.

If the data has been aggregated due to data publication thresholds for that course, it will be clear that data displayed is for all courses in that subject area.

A landscape format widget, with the left side displaying the headline "94% of students were satisfied overall with their course" for the course "Data for Biochemistry (Full time) at Albion University", and the right side inviting the reader to visit Discover Uni for more official course information.
The percentage of students in the National Student Survey that agreed they were overall satisfied.
Another similar widget, except that the headline reads "88% of students agreed staff were good at explaining things".
The percentage of students in the National Student Survey that agreed that staff were good at explaining things.
Another similar widget, except that the headline reads "90% in work or doing further study 15 months after the course".
The percentage of students in work or further study after 15 months (Graduate Outcomes survey).
A landscape widget prominently displaying "Economics and Mathematics at Albion University" and a smaller strapline "To see official information about this course and others visit Discover Uni".
This widget is unable to display the course data, either because the course has multiple instances of data associated with it, or because there is no data available for the items displayed on the widget. Instead the name of the course is displayed and users can click on the 'See course info' button to go to the Discover Uni course page to see the full set of data available for the course.

Planned development of the widget

Autumn 2023: The data displayed on the Discover Uni widget will be changing in the autumn of 2023 when the new annual dataset is published. The changes will not require any action by providers nor any changes to how the widget is set up as detailed in this guidance. 

A landscape example of the new widget
Sample of the new widget design in development.

Decisions about what data will be displayed on the widget will be made in July or August 2023. We anticipate that the widget will continue to display three data items (where the course data is available).

During 2024: We anticipate that a new Discover Uni widget will be developed which will be more configurable, as well as simpler set up functionality. Updated guidance will be provided in good time and prior to the new widget being made available.

A portrait example of the new widget
Sample of the new widget design in development.

How to set up the widget

The widget can be embedded in a web page using either the HTML5+JavaScript snippet or an iFrame.

Depending on your content security settings, you may need to contact the team managing the website you are using to whitelist the 'https://discoveruni.gov.uk' domain for either of these two methods to work.

The widget can be displayed at fixed dimensions either vertically (this is the default), horizontally or responsive.

Course information

There are three essential pieces of course information which are needed to set for the widget to display data for the relevant course. These are:

Information

Status

What this is

PUBUKPRN

 

Essential

This is the UKRLP registration number for the teaching institution under which the course is published on Discover Uni.

KISCOURSEID

Essential

This is the unique course identifier associated with the course in the institution's Unistats data.

KISMODE

Essential for part-time courses

This identifies if the course is 'FullTime' or 'PartTime'. It will default to FullTime if not specified.

This information can be obtained from the URL for a course on the Discover Uni website as set out below:

  1. Search for your institution and select the course on the Discover Uni website

  2. Copy and paste the URL for the course page, for example:
    https://discoveruni.gov.uk/course-details/10796291/K00592/FullTime/

  3. Our URLs are constructed in the format
    https://discoveruni.gov.uk/course-details/PUBUKPRN/KISCOURSEID/KISMODE/

    Therefore, in the example above you would configure the widget with these settings:

    PUBUKPRN = 10796291

    KISCOURSEID = K00592

    KISMODE = FullTime

If your KISCOURSEID contains any of the following characters: '/', '|', ':', '&', '.', '>', '+', '#', ';', '?', '@' and '=' then you will need to replace these characters with an underscore '_' when configuring the widget. For example, if your KISCOURSEID is ABCD/34 then the KISCOURSEID used for the widget will need to be ABCD_34.

Because the widget can also display course information in the Welsh language, the ‘language’ information should be set to 'en-GB' for English – this is the default setting.

Display mode

  • The widget is available in horizontal, vertical, and responsive formats. It will default to vertical if not specified.
  • You can use either HTML+JavaScript or an iFrame to configure your widgets. You can display your widgets using the vertical, horizontal or responsive display mode when using HTML+JavaScript; or the vertical or horizontal display mode in iFrame.
  • You must ensure that all widgets are set up using the height and size styles outlined below.

HTML+JavaScript:

  • Vertical: a fixed size of 190 x 500 pixels
  • Horizontal: a fixed size of 615 x 150 pixels
  • Responsive: The widget will adapt to the width of the containing element and expand its height as necessary. The minimum width is 190 pixels.

iFrame:

The iFrame snippet can only display the widget in vertical or horizontal mode. The responsive mode is no longer supported.

  • Vertical: a fixed size of 198 x 508 pixels
  • Horizontal: a fixed size of 624 x 158 pixels

Embedding the widget

For best compatibility with mobile devices, the hosting page should also contain the following meta tag in the 'head' section.

 <meta name="viewport" content="width=device-width, initial-scale=1.0">

To enable the HTML+JavaScript widget on a page, this script must be added at the bottom of the page before the closing </body> tag. This is not required if you are using iFrame.

<script>

    (function (d) {

      "use strict";

      var widgetScript = d.createElement("script");

      widgetScript.id = "unistats-widget-script";

      widgetScript.src = "//discoveruni.gov.uk/widget/embed-script";

      var scriptTags = d.getElementsByTagName("script")[0];

      if (d.getElementById("unistats-widget-script")) {

        return;

      }

      scriptTags.parentNode.insertBefore(widgetScript, scriptTags);

    })(document);

  </script>

Widget code

Once you have chosen your display mode, pick the corresponding widget HTML to add to your page in the position you would like it to display. In each of these widget HTML snippets, you will need to replace the words PUBUKPRN, KISCOURSEID and KISMODE as explained in the ‘Course information’ section above.

<div class="kis-widget"

style="width:615px; height:150px"

data-institution="PUBUKPRN"

data-course="KISCOURSEID"

data-kismode="KISMODE"

data-orientation="horizontal"

data-language="en-GB"

</div>

<div class="kis-widget"

style="width:190px; height:500px"

data-institution="PUBUKPRN"

data-course="KISCOURSEID"

data-kismode="KISMODE"

data-orientation="vertical"

data-language="en-GB"

</div>

<div class="kis-widget"

style="min-width:190px;"

data-institution="PUBUKPRN"

data-course="KISCOURSEID"

data-kismode="KISMODE"

data-orientation="responsive"

data-language="en-GB"

</div>

<iframe id="unistats-widget-frame" title="Unistats KIS Widget"

src="https://discoveruni.gov.uk/widget/PUBUKPRN/KISCOURSEID/horizontal/small/en-GB/KISMODE"

scrolling="no" style="border: 0px none transparent; width: 624px; height:158px;">

<iframe id="unistats-widget-frame" title="Unistats KIS Widget"

src="https://discoveruni.gov.uk/widget/PUBUKPRN/KISCOURSEID/vertical/small/en-GB/KISMODE"

scrolling="no" style="border: 0px none transparent; width: 198px; height:508px;">

  • Please do not try to override any styles relating to the widget, nor reformat the widget in any way. This will cause presentation issues with the widget or cause it to fail.
  • Do not try to place a widget in a container smaller than the required size for the widget (refer to sizes above).
  • Do not remove the inline height/width styles.
  • Do not try to relocate the script (<script>) for the HTML+JavaScript widget to the <head> or another file. The script must be placed after the widget code in the page (we recommend placing at the bottom of the page before the closing </body> tag).
  • Ensure KISCOURSEID is set correctly as per the Discover Uni course page URL.

If the widget is configured correctly, it will display data for the relevant course and clicking on it will take the user to that course on the Discover Uni website. If it is not configured in a way that corresponds with a course on the website, it will display a standard error message and link to the website homepage.

Contact us

If you have any queries about the configuration or placement of the widget, please contact us:

[email protected]

Published 24 May 2023

Describe your experience of using this website

Improve experience feedback
* *

Thank you for your feedback