Custom tags code is available from the Truepush dashboard. This code needs to be installed in order to create your own user segment apart from the already present segments on the Dashboard.

After you have integrated your Truepush code into your website there is an optional code for custom tags.

There are two ways to add custom tags to your website.

a) Basic integration

b) Google tag manager integration

Basic Integration

STEP 1

Login into Truepush Dashboard and click on the “Code Integration” on the left side of the dashboard.

Code Integration in Truepush


STEP 2

Copy the code as shown highlighted in the above image and paste it anywhere on the website page.

Tag script contains “Tag Name“, “Tag Type” and “Tag Value“.

Tags in Truepush


Note

“Tag Name” can be any value that you want to set. For example, City, Your name, Or any random value

“Tag Type” can be the value mentioned like “String, Number, Boolean, list”.

“Tag Value” is based on the value that you want to set for the parameters. Ex. New York, Daniel, 11222, 33222, etc.

Google Tag Manager (GTM) Integration 

STEP 1

Login into Truepush Dashboard and click on the “Code Integration” on the left side of the dashboard.

Google Tag Manager Code in Truepush


STEP 2

There are 2 options to place the custom tags in your website page.

2.1 First way to do this is to place the SDK code (as number 1 in the image below), and then placing the custom tag code (as number 2 in the image below) below it on the website page.

Place SDK in the backend


2.2 The second way to do is to place the code as shown below.

The code contains the first line of the SDK code (as highlighted in the yellow colour in the image below), and the remaining part is the custom tags code.

2.2.1 Copy the line (as highlighted in the yellow colour) from the SDK code by going to the “code integration” tab on the dashboard.

Code Integration in Truepush


2.2.2 Paste the line along with the custom tag code on the website page as shown below.

Custom Tags in Truepush


Note-This option would help to create separate tags for individual pages.

Examples of using TAG_DATATYPE value with the conditions( as shown in the images below)

1. Example for type string
 
truepush.addTags([{
“tagName”:”email”,
“tagType”:”string”,
“tagValue”: “example@gmail.com
}], function (Error, Response) {
console.log(Error, Response);

});

Segments in Truepush

2. Example for type number
truepush.addTags([{
“tagName”:”Age”,
“tagType”:”number”,
“tagValue”: 13
}], function (Error, Response) {
console.log(Error, Response);

});

Segmentations in Truepush

3. Example for type boolean

truepush.addTags([{
“tagName”:”eligibleForScholarship”,
“tagType”:”boolean”,
“tagValue”: true
}], function (Error, Response) {
console.log(Error, Response);

});

Segments In truepush

4. Example for type list
truepush.addTags([{
“tagName”:”eligibleList”,
“tagType”:”list”,
“tagValue”: [“John”, “David”]
}], function (Error, Response) {
console.log(Error, Response);

});

Also, Read:
API Code – Integration & HTTP/HTTPs Website.
How to use GDPR function on Truepush

Follow us on our Social Media pages.
Facebook|LinkedIn|Twitter

Review us on TrustRadius.

Website: www.truepush.com
Email: help@truepush.com