PRODUCTS, KNOWLEDGE-BASE AND FAQs ENGINE
-
ABOUT US
-
ACCOUNTS
-
AD CENTER (LISITNGS)
- Updating..
-
ANALYTICS
- Annotations
- Create and analyse custom reports
- Create and edit annotations
- Create Dashboards and customise widgets and layout
- Creating a Goal
- Dashboard Configuration
- Data selectors
- DNS Records Explained - Domain Name System Management
- Email Reports
- Getting Started
- Graphs and visualisations
- How do I find the website ID, also called idSite or Site ID?
- How to change the tracking image
- How to Customise Your Dashboard Layout
- How to Manage Existing Widgets
- HOW TO SETUP 2 SUB ENTITIES
- KPI Metric Widget
- Managing Goals
- Set up and analyse Multi Channel Conversion Attribution reports
- The Annotations API
- Using the page overlay feature
- What is a Tag Manager?
- What is the token_auth and where can I find this token to use in the API calls?
- Why is the Bounce Rate in Custom Reports different to Bounce Rate in the Pages report?
- Show all articles (9) Collapse Articles
-
API
- DNS Records Explained - Domain Name System Management
- How do I find the website ID, also called idSite or Site ID?
- How do I use variables within the Custom HTML tag?
- How to change the tracking image
- How to Get M-PESA Keys
- SAFARICOM LIPA NA MPESA APPLICATION SIMPLIFIED
- What is the token_auth and where can I find this token to use in the API calls?
-
BLOG (OUR RESOURCE CENTER)
-
BULK SMS
- Updating..
-
CLOUD DRIVE
- Updating..
-
CYBERSPACE
- Updating..
-
DONATIONS
- Updating..
-
ECOMMERCE-MARKET PLACE
-
EMAILS AND SMTP
-
EPSON
-
IBMS HOSTING
-
Kenya Revenue Authority
-
MPESA
-
NESTICT ICLOUD
-
PMTS PORTALS
-
SCHOOL HOSTING
-
SELF-SERVICE PORTAL
-
SEO
- Updating..
-
TICKET TRACKING
- Updating..
Adsense
< All Topics
Print
How do I use variables within the Custom HTML tag?
PostedMay 1, 2022
UpdatedMay 1, 2022
ByDeveloper
When you define the content of a Custom HTML, you can access the content of any variable within the container through curly brackets. You can assign the variables to a JavaScript variable, to a CSS style, and use it within HTML:
<script>
// correct
var myVariable = {{PageUrl}};
var screenWidth = {{ScreenWidth}};
var pageWidth = myVariable + screenWidth;
// not correct (do not put quotes around it)
var myVariable = '{{PageUrl}}';
// not correct (do not put two variables next to each other)
var pageWidth = {{PageUrl}}{{ScreenWidth}};
</script>
<style>
// correct (can only be used as a value)
body {
width: {{ScreenWidth}};
}
// not correct
body {
{{myVar}}: 15px;
}
</style>
<div>{{PageUrl}} <a href="{{PageUrl}}">Click Me</a></div>
Not sure about the name of a variable? Simply click on the icon next to the text field and a variable selector will open and automatically insert the needed placeholder for the variable.
What is the CSS style value “mTmKpwoqM”?
If you assign a variable as part of a CSS style, the resulted value may be “mTmKpwoqM” if the variable has not returned any value. For example you may notice a body{ color: mTmKpwoqM; }
. This value was chosen to keep your CSS syntax “valid” and so you can find this FAQ article.
Adsense
Table of Contents