if (hbspt.targetedContentMetadata) {
var count = hbspt.targetedContentMetadata.length;
var targetedContentData = [];
for (var i = 0; i < count; i++) {
var tc = hbspt.targetedContentMetadata[i];
if ( tc.length !== 3) {
continue;
}
targetedContentData.push({
definitionId: tc[0],
criterionId: tc[1],
smartTypeId: tc[2]
});
}
metadata["targetedContentMetadata"] = JSON.stringify(targetedContentData);