To obtain the correct HTML code for embedding your event into your website, we recommend that you go to the “Widget” tab of your event’s settings. You can specify some optional settings there (for example the language of the widget) and then click “Generate widget code”.
You will obtain two code snippets that look roughly like the following. The first should be embedded into the
<head> part of your website, if possible. If this inconvenient, you can put it in the
<body> part as well:
The second snippet should be embedded at the position where the widget should show up:
You can of course embed multiple widgets of multiple events on your page. In this case, please add the first snippet only once and the second snippets once for each event.
Some website builders like Jimdo have trouble with our custom HTML tag. In that case, you can use
<div class="pretix-widget-compat" …></div> instead of
<pretix-widget …></pretix-widget> starting with
Your embedded widget could look like the following:
If you want, you can customize the appearance of the widget to fit your website with CSS. If you inspect the rendered
HTML of the widget with your browser’s developer tools, you will see that nearly every element has a custom class
and all classes are prefixed with
pretix-widget. You can override the styles as much as you want to and if
you want to go all custom, you don’t even need to use the stylesheet provided by us at all.
Since buying a ticket normally involves entering sensitive data, we strongly suggest that you use SSL/HTTPS for the page that includes the widget. Initiatives like Let’s Encrypt allow you to obtain a SSL certificate free of charge.
All data transferred to pretix will be made over SSL, even if using the widget on a non-SSL site. However, without using SSL for your site, a man-in-the-middle attacker could potentially alter the widget in dangerous ways. Moreover, using SSL is becoming standard practice and your customers might want expect see the secure lock icon in their browser granted to SSL-enabled web pages.
By default, the checkout process will open in a new tab in your customer’s browsers if you don’t use SSL for your
website. If you confident to have a good reason for not using SSL, you can override this behavior with the
<pretix-widget event="https://pretix.eu/demo/democon/" skip-ssl-check></pretix-widget>
Pre-selecting a voucher¶
You can pre-select a voucher for the widget with the
<pretix-widget event="https://pretix.eu/demo/democon/" voucher="ABCDE123456"></pretix-widget>
This way, the widget will only show products that can be bought with the voucher and prices according to the voucher’s settings.