Thursday, August 21, 2014

How to apply HTML Code Google AdWords Website Call Conversions

 

You need to add a div, span or any other html tag on your pages where you want to show this Google’s auto generated phone no.  This html tag must have an Id or Class name.

See example:  if you are using class name of div or span.
Step 1.  Add Google code within java scripting tag before </head> tag.
<script type="text/javascript">
Paste Google code as it is.Please do not change anything…..
</script>
Step 2.  Add Html Tag like below.

 <body>
  <div class="spanclass">+91-9800-5501-00</div>
</body>

Step 3.  Call _googWcmGet funtion onlaod event of html body tag like

<body onload="applytrackcalls()" >
  <div class="spanclass">+91-9800-5501-00</div>
</body>

Step 4:
Add another java script to declare applytrackcalls() function:
<script type="text/javascript">
  function checkCookie() {

    _googWcmGet(callback, '91-9800-5501-00);
 }
 </script>


See example:  if you are using Id of div or span.
Step 1.  Add Google code within java scripting  tag before </head> tag.
<script type="text/javascript">
Paste Google code as it is.Please do not change anything…..
</script>
Step 2.  Add Html Tag like below.

 <body>
  <div id="spanclass">+91-9800-5501-00</div>
</body>

Step 3.  Call _googWcmGet funtion onlaod event of html body tag like

<body onload="applytrackcalls()" >
  <div id ="spanclass">+91-9800-5501-00</div>
</body>

Stap 4:
Add another java script to declare applytrackcalls() function:
<script type="text/javascript">
  function checkCookie() {

    _googWcmGet(callback, '91-9800-5501-00);
 }

// You need to create another function if you are using Id in tag of div or span and just pass this // id in document.getElementById function.Like I have done

var callback = function(formatted_number, unformatted_number) {
           
            var e = document.getElementById("spanclass");
            e.innerHTML = ""
            e.appendChild(document.createTextNode(formatted_number));
        };

 </script>

Note : If this is still not working the you can debug the error by using try catch method  on _
googWcmGet function Like:
 try
{
    _googWcmGet(callback, '91-9800-5501-00);
 }
Catch(e){
Alert (“Error on Implementing Google code : ” + e);

}



Devendra Kumar
Sr. Web Developer
Apextierteechnologies.com