Publish settings
Publishing the built Riddle after creation
The request body parameter “publish” can be sent with the API to publish the Riddle right after creation, making it easier to embed the generated content on the web page.
Example:
{
"type": "Poll",
"publish": true,
"build": {
"blocks": [...]
}
}
Advanced settings
With these publish settings you can define any settings found in the Riddle Creator Publish screen.
Properties
You can specify the following optional properties:
Property | Type | Description |
---|---|---|
isShowcaseEnabled | boolean | Set to false if your Riddle should not be accessible via direct Riddle link (e.g. riddle.com//view/XXX) |
isDoiEnabled | boolean | Set to true if you want to enable the Double-Opt-In Feature. For this to work you must add an email address form field first. Learn here how to add form fields. |
doiConfig | object | Further configuration for the Double-Opt-In Feature; more information below |
isEmailAutomationEnabled | boolean | Set to true if you want to enable the email automation feature. For this to work you must add an email address form field first. Learn here how to add form fields. |
emailAutomationConfig | object | Further configuration for the email automation feature; more information below |
dataLayerItems | object | A key-value array to create data layer variables; more information below |
tracking | string[] | Tracking configuration; more information below |
integrations | object | Specify existing integrations to enable; more information below |
Example
The publish settings properties are sent in the publish
property of the build object, here's how it looks:
{
"blocks": [...],
"publish": {
"isDoiEnabled": true,
...
}
}
Integrations
You can add existing Googlesheets & webhook integrations to your Riddle. To do this, you can specify integrations
in your publish
object.
Example:
{
"blocks": [...],
"publish": {
"integrations": {
"googlesheets": "test@riddle.com",
"webhook": "example.com./webhook"
}
}
}
In this example we already connected the Googlesheets integration with the email test@riddle.com
and the webhook integration with the URL example.com./webhook
. The name of the integration you send here must match with the name displayed on the integrations page in the Riddle Creator.
If the integration cannot be found, the Riddle build will fail and you will get a RIDDLE_BUILDER_BLOCK_PROPERTY_VALUE_INVALID
error from the API.
DOI
To enable DOI, first set isDoiEnabled
to true
:
{
"isDoiEnabled": true
}
Enabling it will set the first email field in the Riddle as the DOI field.
If you want to customize the DOI email or confirmation page, you can send the following properties in doiConfig
:
emailSubject
: the DOI email subjectemailText
: the DOI email textemailConfirmationButtonLabel
: the label of the confirmation button in the DOI emailconfirmationPageHeadline
: the headline of the confirmation pageconfirmationPageText
: the text of the confirmation pageconfirmationPageUrl
: the URL the user is redirected to after confirming the DOI
Note: If you send a confirmationPageUrl
property, the other confirmation page properties are redundant as the user gets redirected to the URL immediately after confirming the DOI (user does not see extra confirmation page headline/text).
Tip: Use dynamic variables for any of the DOI properties to personalize this flow to user input.
Example:
{
"isDoiEnabled": true,
"doiConfig": {
"emailSubject": "Please confirm your email %name",
"emailText": "Hi %name, Please confirm your email by clicking the button below.",
"emailConfirmationButtonLabel": "Confirm email",
"confirmationPageHeadline": "Thank you for confirming your email",
"confirmationPageText": "You can now access the content",
"confirmationPageUrl": "https://www.example.com"
}
}
Email automation
To enable email automation, first set isEmailAutomationEnabled
to true
:
{
"isEmailAutomationEnabled": true
}
Enabling it will set the first email field in the Riddle as the email automation field.
If you want to customize the email that is sent, you can send the following properties in emailAutomationConfig
:
subject
: the email subjecttext
: the email text
Tip: Use dynamic variables for any of the email automation properties to personalize this flow to user input.
Example:
{
"isEmailAutomationEnabled": true,
"emailAutomationConfig": {
"subject": "Thank you for participating %name!",
"text": "Thank you for participating in our quiz %name. Here are your results: ..."
}
}
Data Layer
The Riddle Data Layer can be setup with the dataLayerItems
property which is a key-value array: The key is the key of the data layer variable (this is used to push to it, e.g. riddle.com/view/XXX?key=value or dataLayer.push({ key: value })
) and the value is the title of the variable which will be used in the export as the data layer column name.
Example: Adding three data layer variables:
{
"dataLayerItems": {
"utm_source": "Source",
"utm_medium": "Medium",
"utm_campaign": "Campaign"
}
}
Tracking
With the tracking
property you can define which tracking should be enabled for your Riddle. By default no tracking is enabled.
The following tracking options are available (case-sensitive):
- facebookPixel
- googleAnalytics
- googleAnalytics4
- googleTagManager
- matomoTag
Example: Activating Google Tag Manager and Matomo Tag:
{
"tracking": ["googleTagManager", "matomoTag"]
}
Full example
{
"type": "Poll",
"publish": true,
"build": {
"publish": {
"isDoiEnabled": true,
"doiConfig": {
"emailSubject": "Please confirm your email %name",
"emailText": "Hi %name, Please confirm your email by clicking the button below.",
"emailConfirmationButtonLabel": "Confirm email",
"confirmationPageHeadline": "Thank you for confirming your email",
"confirmationPageText": "You can now access the content",
"confirmationPageUrl": "https://www.example.com"
},
"isEmailAutomationEnabled": true,
"emailAutomationConfig": {
"subject": "Thank you for participating %name!",
"text": "Thank you for participating in our quiz %name. Here are your results: ..."
},
"dataLayerItems": {
"utm_source": "Source",
"utm_medium": "Medium",
"utm_campaign": "Campaign"
},
"tracking": ["googleTagManager", "matomoTag"],
"integrations": {
"googlesheets": "test@riddle.com",
"webhook": "https://www.example.com./webhook"
}
}
}
}