iQ Tags API
iQ Tags API uses a PATCH method to update profile tags.
To learn more about this API and available object fields, see iQ Profiles API and iQ Profiles Objects.
How it works
Use the PATCH
method to create, update, and delete components in the iQ Profile object.
PATCH /v3/tiq/accounts/{ACCOUNT}/profiles/{PROFILE}
When you use the PATCH method, you are making changes to your profile tags programmatically using a save or save-as. After making changes with the API, you must still log into the application to publish.
Example cURL request
curl --location --request PATCH 'https://platform.tealiumapis.com/v3/tiq/accounts/{ACCOUNT}/profiles/{PROFILE}' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzUx...MiJ9' \
--header 'Content-Type: application/json' \
--data '
Authentication
The bearer token is used to authenticate all API calls and not the API key. The API key is only used in the authentication call. In addition to the bearer token, the authentication response includes a region-specific hostname that must be used in subsequent server-side API calls.
To learn about generating a bearer token from the API key, see Authentication.
Profile fields
Profile tags are JSON objects that contain the following possible fields:
OBJECT | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
versionTitle |
String | Optional | The title of the resulting saved version. Default with saveType set to saveAs : API | {TIMESTAMP} Default with saveType set to save : Existing version title |
saveType |
String | Optional | The type of save to perform with the PATCH request: save or saveAs . Default is saveAs . |
notes |
String | Required | Additional notes about the publish version. |
operationList |
Array | Required | A list of operation objects. For example, multiple tags. |
op |
String | Required | The operation to perform: add , replace , or remove . |
path |
String | Required | The component type and ID to update, in the format:/{TYPE}/{ID} . |
value.object |
String | Required | The object type being updated: variable , extension , event , or tag . |
value.tagID |
String | Required | The unique tag template ID. Use a GET request to retrieve the tag ID. Note that this value is different from the tag UID. |
value.status |
String | Optional | The on/off status: active or inactive . |
value.notes |
String | Optional | Notes about the tag. |
value.title |
String | Required (for add/replace) | Name of the tag. |
value.selectedTargets |
Map <string, Boolean> | Optional | An object of environments to publish the component to. { "prod" : true|false, "qa" : true|false, "dev" : true|false } Default: All environments set to true . |
value.tagConfiguration |
Map <String, Object> | Optional | A String and Object Map of tag configurations made available by the vendor. Configurations are specific to each tag. For more information, see the documentation for your tag. |
value.advancedConfiguration |
Object | Optional | A set of advanced configurations corresponding to the tag configuration settings. advConfigBundle — True or FalseadvConfigLoadType — True or FalseadvConfigOptOut — TrueadvConfigSend — True or False advConfigSrc — Text fieldtagTiming — DOM Ready or Prioritized |
value.rules |
Object | Optional | The load rules to apply or exclude from the tag. |
value.dataMappings |
Map <String, String> | Optional | The Tealium IQ variable and its corresponding mapped destination. You can verify the specific format for the mapped variable triggers in the Data Mappings screen in your tag configuration. |
Example request
{
"versionTitle": "Version 2022.03.22.2108",
"saveType": "saveAs",
"notes":"version notes",
"operationList": [
{
"op": "add",
"path": "/tags",
"value":{
"object":"tag",
"tagId": "7133",
"status": "active",
"notes": "",
"title": "Google Analytics (gtag.js)",
"selectedTargets": {
"qa": true,
"dev": true,
"prod": true
},
"tagConfiguration": {
"config_cross_track_domains": "",
"config_allow_display_features": "false",
"config_tracking_id": "UA-12345678-1",
"config_allow_anchor": "false",
"config_data_layer_name": "",
"config_enhanced_link_attribution": "false",
"config_use_amp_client_id": "false",
"config_optimize_id": "",
"config_screen_view": "false",
"config_cross_track": "false",
"config_transport_type": "default",
"config_gaobject": "",
"config_anonymize_ip": "false",
"config_clear_global_vars": "false"
},
"advancedConfiguration": {
"bundleFlag": false,
"syncLoadType": true,
"optout": true,
"scriptSource": "",
"sendFlag": true,
"tagTiming": "Dom Ready"
},
"rules": {
"apply": [
{"and": [{"or": [{"uid": 52, "type": "loadRule"}]}]}
],
"exclude": []
},
"dataMappings": [
{
"mappings": ["true:present_offer"],
"type": "va",
"variable": "badges.30"
},
{
"mappings": ["event.start_date"],
"type": "udo",
"variable": "dates.23"
},
{
"mappings": ["config.page_title"],
"type": "udo",
"variable": "page_name"
}
],
}
}
]
}
PATCH operation parameters
Instead of POST
, PUT
, and DELETE
methods, the PATCH
method uses the op
parameter to specify the action to perform.
The op
parameter supports the following values:
add
- Create the component.replace
- Update the component.remove
- Delete the component.
To specify the the type and ID of the component, use the path
parameter. The path
parameter format is /{TYPE}/{ID}
.
For example, to add a tag use:
"op" : "add",
"path" : "/tags"
To update a specific tag, add the ID to the path:
"op" : "replace",
"path" : "/tags/503"
Create tag
This PATCH method takes a profile object and additional tag fields.
Example request
{
"versionTitle": "Version 2022.03.22.2108",
"saveType": "saveAs",
"notes":"version notes",
"operationList": [
{
"op": "add",
"path": "/tags",
"value":{
"object":"tag",
"tagId": "7133",
"status": "active",
"notes": "",
"title": "Google Analytics (gtag.js)",
"selectedTargets": {
"qa": true,
"dev": true,
"prod": true
},
"tagConfiguration": {
"config_cross_track_domains": "",
"config_allow_display_features": "false",
"config_tracking_id": "UA-12345678-1",
"config_allow_anchor": "false",
"config_data_layer_name": "",
"config_enhanced_link_attribution": "false",
"config_use_amp_client_id": "false",
"config_optimize_id": "",
"config_screen_view": "false",
"config_cross_track": "false",
"config_transport_type": "default",
"config_gaobject": "",
"config_anonymize_ip": "false",
"config_clear_global_vars": "false"
},
"advancedConfiguration": {
"bundleFlag": false,
"syncLoadType": true,
"optout": true,
"scriptSource": "",
"sendFlag": true,
"tagTiming": "Dom Ready"
},
"rules": {
"apply": [
{"and": [{"or": [{"uid": 52, "type": "loadRule"}]}]}
],
"exclude": []
},
"dataMappings": [
{
"variable": "page_name",
"type": "udo",
"mappings": ["config.page_title"]
}
],
}
}
]
}
Update tag
This PATCH method takes a profile object and additional tag fields.
Example request
{
"versionTitle": "Version 2022.03.22.2108",
"saveType": "saveAs",
"notes":"version notes",
"operationList": [
{
"op": "replace",
"path": "/tags/49",
"value":{
"object":"tag",
"tagId": "7133",
"status": "active",
"notes": "",
"title": "Google Analytics (gtag.js)",
"selectedTargets": {
"qa": true,
"dev": true,
"prod": true
},
"tagConfiguration": {
"config_cross_track_domains": "",
"config_allow_display_features": "false",
"config_tracking_id": "UA-12345678-1",
"config_allow_anchor": "false",
"config_data_layer_name": "",
"config_enhanced_link_attribution": "false",
"config_use_amp_client_id": "false",
"config_optimize_id": "",
"config_screen_view": "false",
"config_cross_track": "false",
"config_transport_type": "default",
"config_gaobject": "",
"config_anonymize_ip": "false",
"config_clear_global_vars": "false"
},
"advancedConfiguration": {
"bundleFlag": false,
"syncLoadType": true,
"optout": true,
"scriptSource": "",
"sendFlag": true,
"tagTiming": "Dom Ready"
},
"rules": {
"apply": [
{"and": [{"or": [{"uid": 52, "type": "loadRule"}]}]}
],
"exclude": []
},
"dataMappings": [
{
"variable": "page_name",
"type": "udo",
"mappings": ["config.page_title"]
}
],
}
}
]
}
Delete tag
This PATCH method takes a profile object and additional tag fields.
Example request
{
"versionTitle": "Version 2022.03.22.2108",
"saveType": "saveAs",
"notes":"",
"operationList": [
{
"op": "remove",
"path": "/tags/230",
"value":{
"object":"tag"
}
}
]
}
Error messages
Potential error messages for this endpoint:
ERROR CODE | ERROR MESSAGE |
---|---|
400 | "Profile libraries are out of date, merge changes before patching profile - {ACCOUNT} | profile: {PROFILE}" "patchProfile.arg2.notes: must not be empty" |
404 | "Profile not found - account: {ACCOUNT} | profile: {PROFILE}" "Profile library not found - account: {ACCOUNT} | profile: {PROFILE}" "Profile (legacy) not found - account: {ACCOUNT} | profile: {PROFILE}" "Users are currently viewing the same account: {ACCOUNT} | profile: {PROFILE}" "Latest version not found - {ACCOUNT} | profile: {PROFILE}" |
409 | "Error saving profile: {PROFILE} for account: {ACCOUNT}, duplicate versions: {VERSION}" |
500 | "Profile: {PROFILE} inherits from library profile" "Error saving profile metadata - account: {ACCOUNT} | profile: {PROFILE}" "Error saving profile - account: {ACCOUNT} | profile: {PROFILE}" "Error saving profile(legacy) - {ACCOUNT} | profile: {PROFILE}" |
This page was last updated: June 21, 2024