Click or drag to resize
GtmDataHelperSerializeToJsonInternal Method (GtmData, String)
Serializes gtmData to JSON.

Namespace: CMS.Ecommerce
Assembly: CMS.Ecommerce (in CMS.Ecommerce.dll) Version: 12.0.0
Syntax
C#
protected virtual string SerializeToJsonInternal(
	GtmData gtmData,
	string purpose = null
)

Parameters

gtmData
Type: CMS.EcommerceGtmData
Data to be serialized to JSON.
purpose (Optional)
Type: SystemString
Contextual information fitting for customizations.

Return Value

Type: String
JSON representation of gtmData.

Return Value

Type: String
The gtmData serialized to string.
Examples

To customize gtmData before serialization, override this method in similar fashion.

gtmData.Add("key", "value");

base.SerializeInternal(gtmObject, purpose);

To customize the whole serialization process do not call base implementation and implement custom gtmData serialization.

See Also