Create New Container

Go to http://www.google.com/tagmanager/ Click Sign up now (1) button and go through the registration procedure, or click Sign in (2) if you already have the google account.

1.png

 

If you do not have other Tag Manager accounts after entering the Google account you will be taken to a page creation Tag Manager account, otherwise from the All Accounts page in Google Tag Manager, click New Account.

1.png

Enter Account Name and click the Next button.

After creating a Tag Manager account, you will create a container.

1.png

 

Enter Container Name and select Mobile Apps.

1.png

 

Select Supported Mobile Platforms and Time Zone and click Create Account and Container button.

Read and Accept Google Tag Manager Terms of Service Agreement.

1.png

 

Container created click Configure Container button to configure you container.

1.png

If you already have Tag Manager account, for creating container you need on page your account click New button and select Container from the drop-down list and repeat steps 6 - 9.

  1. Create variables in container.

  1. Add string variable.

In the container, page goes to Container Draft →Overview tab (1)

1.png

 

Click NEW button and select Macro (2) from the drop-down list.

1.png

 

On page Create New Macro enter Macro Name (1), select from drop-down list Macro Type (2) Constant String, enter Value (3) and click Save button. Get string from container by call TagManagerObject.Instance.GetString (“Macro Name”).

Warning: After making changes to the container do not forget to publish a version of the container by pressing the Publish.

 

Add double, long and boolean variables.

In the container, page goes to Container Draft →Overview tab (1)

1.png

 

Click NEW button and select Macro (2) from the drop-down list.

1.png

On page Create New Macro enter Macro Name (1), select from drop-down list Macro Type (2) Value Collection, enter Value Collection (3) and click Save button. Value Collection contains a the set of key-value pairs expressed in JSON format. For example:

{âLong valueâ: 10, âDouble valueâ: 10.25, âBool valueâ: true, âString valueâ: âthis is stringâ}. 

Get the value from the container by:

TagManagerObject.Instance.GetLong("Long value");
TagManagerObject.Instance.GetDouble("Double value"); 
TagManagerObject.Instance.GetBoolean("Bool value");
TagManagerObject.Instance.GetString("String value"); 

 As can be seen from the example string variables can also be added to the collection of variables. Do not forget to publish a new version of the container after changes.

 

Read the next article to find out how to retrieve data from the container.