Ways to use Timestamp Converter Variable
Step 1: Create a new variable in your Google Tag Manager Server Container.
- Clone or download this repository.
- Go to your Google Tag Manager Server Container and go to the
Templatestab on the left menu. - Create a new
Variable Templateby clicking on theNewbutton. This will open theTemplate Editor. - On the
Template Editorpage, click on theImportbutton and select thetemplate.tplfile from the repository. - Click on the
Savebutton.
Step 2: Setting up the user-defined variable.
- Go to the
Variablestab on the left menu. - Create a new
User-Defined Variableby clicking on theNewbutton. This will open theVariable Editor. - On the
Variable Editorpage, select theTimestamp Convertertemplate from theVariable Typedropdown. - Choose a Conversion Type from the
Conversion Type. The available options areTimestamp to ISOandISO to Timestamp. - Enter
current_timestampif you want to get the current timestamp and generate it dynamically.
Step 3: Using the variable in your Custom tag template.
- Go to the
Templatestab on the left menu and open your custom tag template. - Add a new field to your custom tag template with a name like
timestamporevent_atand save. - Go to the
Tagstab on the left menu and open your custom tag. - Within your custom tag, fields you now will the field you have added.
- Attach the custom user-defined variable you have created in step 2 to that field.
Open Source
Initial development of timestamp ↔ ISO was done by Ram Manohar.
Timestamp Converter Variable for GTM Server is developing and maintained by Stape Team under the Apache 2.0 license.