stape-io / timestamp-converter-variable

Timestamp Converter Variable for Google Tag Manager Server Container
https://stape.io
Apache License 2.0
4 stars 1 forks source link

README update: Proposing an update for readme on how to use this variable. #2

Closed ahmedmaazin closed 1 year ago

ahmedmaazin commented 1 year ago

Thank you for this timestamp converter variable.

Below is how I have used this variable. This is of cox, one way to use it, but if you happen to like the approach, updating the readme would be great (disclaimer: I tried to create a PR, but seems like I can't contribute) :)

Ways to use this Timestamp Converter Variable.

In a custom tag template

Step 1: Create a new variable in your Google Tag Manager Server Container.

  1. Clone or download this repository.
  2. Go to your Google Tag Manager Server Container and go to the Templates tab on the left menu.
  3. Create a new Variable Template by clicking on the New button. This will open the Template Editor.
  4. On the Template Editor page, click on the Import button and select the template.tpl file from the repository.
  5. Click on the Save button.

Step 2: Setting up the user-defined variable.

  1. Go to the Variables tab on the left menu.
  2. Create a new User-Defined Variable by clicking on the New button. This will open the Variable Editor.
  3. On the Variable Editor page, select the Timestamp Converter template from the Variable Type dropdown.
  4. Choose a Conversion Type from the Conversion Type. The available options are Timestamp to ISO and ISO to Timestamp.
  5. Enter current_timestamp if you want to get the current timestamp and generate it dynamically.

Step 3: Using the variable in your Custom tag template.

  1. Go to the Templates tab on the left menu and open your custom tag template.
  2. Add a new field to your custom tag template with a name like timestamp or event_at and save.
  3. Go to the Tags tab on the left menu and open your custom tag.
  4. Within your custom tag, fields you now will the field you have added.
  5. Attach the custom user-defined variable you have created in step 2 to that field.
Bukashk0zzz commented 1 year ago

Thank you for your description and willingness to help. I added this text to README.

I checked we don't have restrictions in terms of creating PR.