What is a Hidden Field?


A hidden field (also referred to as a custom variable) allows you to capture and store data without showing it to the participant. This data is passed via URL parameters and used to improve backend data collection, personalize user experiences, and track information seamlessly—without requiring any action from the user. Hidden fields work behind the scenes to enhance the functionality of your interactions.


Before You Start


CredSpark includes several built-in hidden fields, so if you’re looking to track any of the information below, you do not need to create new hidden fields. However, you will still need to add these fields to the URL—more details on that below. The built-in fields available are:


Email: user_email

First Name: user_first_name

Last Name: user_last_name

User UUID: user_uuid


These fields automatically appear in CredSpark’s reporting, so any values captured will be displayed there.


How to Create Hidden Fields 


Hidden fields can be used in different ways: through direct links, Q1 email embeds, or embed codes. We’ll guide you through each method, starting with the most common: adding hidden fields to a link.


1. To create a hidden field navigate to “Deliver” tab and click “Add/Manage Hidden Fields”:



2. A modal will appear where you can create and edit your hidden fields. Here, you can also set a reporting value, which will show up in your data reports to help identify the hidden field later.


3. Once the hidden fields are created, they will be added to your link. Note that hidden fields are case-sensitive.


4. After creating your hidden fields, copy the link to a text document (e.g., Google Docs or Excel) and replace the "XXXXX" with the actual values you want to pass through the URL. After creating your hidden fields, copy the link to a text document (e.g., Google Docs or Excel). Replace the "XXXXX" with the specific values you want to pass through the URL. Typically, this is done by inserting a merge variable from your CRM, CDP, or email platform (e.g., *|CAMPAIGN_UID|* for Mailchimp). Refer to your platform’s guidance for the correct merge variable format to ensure accurate data capture.


5. With your hidden fields and values in place, the final step is to share the modified link with your audience. The hidden fields will automatically collect and track the specified data as participants engage with the link.


Note: If you're using built-in hidden fields, you still need to manually add them to the link. For example, if you want to pass an email address instead of a campaign ID, add the email field to your link like this: https://app.credspark.com/assessments/feedback-survey-31e8a7d0d08c6/assessment_responses/new?user_email=[merge value]


Example Use Case: Sending CredSpark’s Direct Link via Mailchimp 


To illustrate how hidden fields work, let’s walk through an example using Mailchimp to send a CredSpark interaction. In this case, we’ll pass a unique email campaign ID to each participant’s response.


1. Prepare the Direct Link:

After creating your interaction and adding hidden fields, copy the generated link. In this case, replace the placeholder "XXXXX" with a Mailchimp merge tag that dynamically pulls the email campaign ID: 


https://app.credspark.com/assessments/feedback-survey-31e8a7d0d08c6/assessment_responses/new?campaign=*|CAMPAIGN_UID|*


2. Deploy the Send:

In this example, the Mailchimp merge tag *|CAMPAIGN_UID|* will dynamically insert the campaign ID into the URL. This enables Mailchimp to pass the campaign ID information to CredSpark when users engage with the survey.


Once the email is sent, and a recipient clicks the link, Mailchimp will automatically pass the unique campaign ID to CredSpark, where it is recorded as part of the hidden field data. 


3. View the Data:

After participants complete the interaction, you can view the captured campaign IDs in CredSpark's reporting dashboard. The hidden field value (in this case, "Campaign ID") will appear based on the reporting label you specified when setting up the hidden field.


Using Hidden Field with Q1 Email Embed 


In addition to using hidden fields with a direct link, you can also use them with the Q1 Email embed feature. Whether you’re embedding the CredSpark Q1Email using our direct link or another link where the interaction is embedded (such as a link within your website or blog), make sure to include the merge variable in the link itself—this is essential for passing values accurately to CredSpark.



The email campaign data will be captured and displayed in CredSpark’s reporting, just as it would with a direct link.


Using Hidden Fields with Embed Code 


Hidden fields can be used with embed codes in several ways, depending on your specific needs. Below are two common use cases, but they are not the only possibilities. You can adapt hidden fields to suit various tracking or data collection goals.


Passing Embed Code Hidden Values to Reporting:

If you embed the same code across multiple locations (e.g., your homepage and a blog post), you can track which source generates more traffic. To do this, create a hidden field (e.g., "source") and add it to your embed code.


Original Code:

<script type="text/javascript" src="https://app.credspark.com/assessments/hidden-field-demo-d7ab1fa328912/embed_script.js" async defer></script> <div class="credsparkQuiz" data-quiz-id="hidden-field-demo-d7ab1fa328912"></div>


Updated with Hidden Field:

<script type="text/javascript" src="https://app.credspark.com/assessments/hidden-field-demo-d7ab1fa328912/embed_script.js" async defer></script> <div class="credsparkQuiz" data-quiz-id="hidden-field-demo-d7ab1fa328912"

data-hidden-fields="source=home"></div>


Repeat this process for other locations, like your blog post, by updating the "source" value (e.g., data-hidden-fields="source=blog").

In your reporting, you will see which page each participant came from. If you need to track multiple hidden values, you can separate them using the “&” symbol (e.g., data-hidden-fields="source=home&campaign=summer2024").



Grabbing Values from the Parent Page:

Another use case is embedding a CredSpark interaction and passing data from the parent page to CredSpark. This data, such as a user ID, product ID, or article title, has to be included in the parent page’s URL for seamless data transfer. To achieve this, simply add a hidden field in CredSpark and specify what value the app should capture.


For example, if your interaction includes a hidden field called "product" and a participant accesses the quiz through a URL ending in ?product=A, the value "A" will be recorded in the "product" column in the report. You can also add multiple hidden fields by separating them with an “&” symbol to track additional data points.


What’s Next?


Currently, Hidden Fields do not support Piping Logic or Display Logic. However, we plan to introduce these capabilities in future releases to enhance the flexibility and functionality of Hidden Fields.


Hidden Fields and Custom Tags


While CredSpark still supports Custom Tags, this feature is limited and will eventually be replaced by Hidden Fields. We encourage you to begin transitioning to Hidden Fields, as Custom Tags will be deprecated in the near future. There's no immediate need to remove existing Custom Tags, but switching now will ensure smoother adoption of future updates.