Including Tracking Parameters Such as GCLID in the Configuration
Question
> We want to know which ad campaign a request originated from. To do this, we need to save the GCLID from the request URL and include it in the internal notification email. How do we do this?
Answer
This is done using a hidden text attribute: Each attribute value can be set via a URL parameter when the configurator is launched and is saved along with the configuration.
1. Enable developer mode
To assign a unique key to a feature, you need to enable developer mode:
- Click the K3 logo in the upper-left corner of the editor.
- Open the menu in the upper-right corner next to your email address and select Profile.
- Enable Developer Mode.
2. Create a hidden text feature
- Create a new text feature in the configurator, for example, with the name "GCLID".
- Assign the key
gclid. - Hide the attribute in the configurator so that it is not visible to the end customer.
3. Pass the Value When Calling the Configurator
Append the value as a complete parameter to the configurator URL:
...?app=<Ihr Konfigurator>&gclid=<dynamischer Wert>
The parameter name corresponds to the feature’s key. The value alone, without &gclid=, is not sufficient. If the configurator is embedded via an iFrame, the parameter must be passed to the iFrame URL on your page.
4. Outputting the Value in the Internal Email
- In the editor, click Options in the sidebar and switch to the Mail tab.
- Edit the template
cfg-internal. - Retrieve the attribute before outputting it:
{% set gclid = cfg.json.summary | filter(l => l.variableKey=='gclid') | first %}
- Output the value at the desired location:
{% if gclid %}
GCLID: {{ gclid.selectionLabel }}
{% endif %}
The key used in the template must match the attribute’s key exactly.
This procedure is not limited to the GCLID. Campaign IDs, sources, merchant numbers, or other identifiers can be incorporated in the same way—one hidden attribute per value.
Completion actions trigger an event when saved. The action key allows you to distinguish which action was used, such as “Request” or “Bookmark.” This is useful when analyzing conversions in Tag Manager.
Further Information
- Kontaktformular und Abschluss – Passing Attribute Values via the URL
- PROTECTED_6 – Customize email templates
- Analytics – Google Tag Manager and the available K3 events
Related Topics
- Hide a feature
- Configurator startup parameters
- Customize internal email