Skip to content

giovaniortolani/convert-to-string-sgtm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Convert to String Variable template for Server-Side GTM

Converts an entity of any type (string, number, boolean, null, undefined, Array, Object or Function) to a string.

Until now, there isn't a built-in or community template that does such thing for Array and Object.


Simply provide a reference to any variable you want to convert to a string. This template can handle the following data types:

  • string
  • number
  • boolean
  • null
  • undefined
  • Array
  • Object
  • Function

Conversion Options

  • Arrays: You can choose to stringify arrays using Array.join() instead of the default JSON.stringify().
  • Null and Undefined: By default, null and undefined are converted to their string equivalents ("null" and "undefined"). You can configure the template to return them as their original types.
  • Functions: Providing a Function will result in undefined.

Author(s)

Giovani Ortolani Barbosa

About

Converts an entity of any type (string, number, boolean, null, undefined, Array, Object or Function) to a string.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published