Add Custom Tag to HTTP/HTTPS

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 optional code for custom tags.

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

a) Basic integration

b) Google tag manager integration


a) Basic Integration

STEP 1

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


STEP 2

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

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

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.


b) Google Tag Manager (GTM) Integration 

STEP 1

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


STEP 2

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

2.1 First way to do 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 in the website page.

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 in the “code integration” tab on the dashboard.

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

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);

});

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

});

3. Example for type boolean

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

});

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