thread216-1057021
hello world : ), Willronin here, this is my first post in this forum!
I came across the above thread recently:
in case you can not find it here is the URL of the tread I am talking about:
I felt the tread originator's frustration at getting answers that where not addressing his question instead where answers completely off the amrk or attempted to open discussion on the manipulation of google code.
StormBind posted a couple of guestimates that did not address the problem in question and hopes for the best.. nice try, no dice!
then Kahn comes in and flames the poster for getting frustrated at not getting an answer!!! yes you are right no one here gets pay for helping another person and people should be gracious and thankful when getting help from others, BUT that does not give you/us the liberty to completely disregard and not attempt to at least understand the issue in question. - understand the question before providing an answer, or at least reach out and ask for some sort of clarification. don't just throw an answer out there and hope it sticks.
now for waht I hope is the right answer, and maybe some other unfortunate weary web traveler doing battle with the DOM beast of the world wide web will find in this little corner of the web a sanctuary and respite form her or his journey.
google tracking code as its given by google:
<!-- Google Code for Lead Conversion Page -->
<script language="JavaScript" type="text/javascript">
<!--
function googleAdword(){
var google_conversion_id = **********;
var google_conversion_language = "en_GB";
var google_conversion_format = "1";
var google_conversion_color = "666666";
if (0) {
var google_conversion_value = 0;
}
var google_conversion_label = "Lead";
//-->
}
</script>
<script language="JavaScript" src="</script>
what our unfortunate poster was asking was:
how can he prevent conversion.js from being triggered on page load?
he was asking how could he place the conversion.js inside a function which he could trigger from within a flash button?
Below we will deliver what we hope is the correct solution.
After that we will explain the solution, so that others attempting to implement the solution can better trouble shoot it and hopefully add to this Post and thereby increasing our collective knowledge.
place this inside the header or somewhere within the body of your HTML document.
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-15586217-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? ' : ' + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
function injTrckPxls ()
{
/* this is google code parameters - please do not change - you may extend the declarations. */
_gaq.push(['_trackEvent', 'declaration1', 'declaration2', 'declaration3']);
/* begin pixel code injection */
document.getElementById('declaration1').innerHTML = 'WRITE YOUR HTML IN HERE';
document.getElementById('declaration2').innerHTML = 'WRITE YOUR HTML IN HERE';
document.getElementById('declaration3').innerHTML = 'WRITE YOUR HTML IN HERE';
}
</script>
create some divs to receive the HTML form the javascript.
normally this elements are placed aright before the closing </body> tag,
<div id="declaration1"></div>
<div id="declaration2"></div>
<div id="declaration3"></div>
so what are we doing.
simple we have a function called injTrckPxls
this function needs to be called from the flash movie.
if not called no tracking will occurred.
when triggered the functiom will inject WHATEVER code you place in the innerHTML declaration
this could be iframe, and image, another div, or another javascript if so we desire.
we are tunneling thru the DOM via document once we are in document we search the innerHTML and we look for our declarations' ID via getElementByID once find it we write our own html snippet.
in the posters' case the correct way to place the conversion.js would be
document.getElementById('declaration3').innerHTML = '<script type="text/javascript" src="
so that when his flash button is clicked, the conversion.js is injected into the html page.
this approach can also be use to inject pixel tracking code that resides in a img src tag or in an iframe.
hope this helps someone facing the same issue, remember we are not experts, we are hobbist we a passion for coding.
Willronin
hello world : ), Willronin here, this is my first post in this forum!
I came across the above thread recently:
in case you can not find it here is the URL of the tread I am talking about:
I felt the tread originator's frustration at getting answers that where not addressing his question instead where answers completely off the amrk or attempted to open discussion on the manipulation of google code.
StormBind posted a couple of guestimates that did not address the problem in question and hopes for the best.. nice try, no dice!
then Kahn comes in and flames the poster for getting frustrated at not getting an answer!!! yes you are right no one here gets pay for helping another person and people should be gracious and thankful when getting help from others, BUT that does not give you/us the liberty to completely disregard and not attempt to at least understand the issue in question. - understand the question before providing an answer, or at least reach out and ask for some sort of clarification. don't just throw an answer out there and hope it sticks.
now for waht I hope is the right answer, and maybe some other unfortunate weary web traveler doing battle with the DOM beast of the world wide web will find in this little corner of the web a sanctuary and respite form her or his journey.
google tracking code as its given by google:
<!-- Google Code for Lead Conversion Page -->
<script language="JavaScript" type="text/javascript">
<!--
function googleAdword(){
var google_conversion_id = **********;
var google_conversion_language = "en_GB";
var google_conversion_format = "1";
var google_conversion_color = "666666";
if (0) {
var google_conversion_value = 0;
}
var google_conversion_label = "Lead";
//-->
}
</script>
<script language="JavaScript" src="</script>
what our unfortunate poster was asking was:
how can he prevent conversion.js from being triggered on page load?
he was asking how could he place the conversion.js inside a function which he could trigger from within a flash button?
Below we will deliver what we hope is the correct solution.
After that we will explain the solution, so that others attempting to implement the solution can better trouble shoot it and hopefully add to this Post and thereby increasing our collective knowledge.
place this inside the header or somewhere within the body of your HTML document.
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-15586217-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? ' : ' + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
function injTrckPxls ()
{
/* this is google code parameters - please do not change - you may extend the declarations. */
_gaq.push(['_trackEvent', 'declaration1', 'declaration2', 'declaration3']);
/* begin pixel code injection */
document.getElementById('declaration1').innerHTML = 'WRITE YOUR HTML IN HERE';
document.getElementById('declaration2').innerHTML = 'WRITE YOUR HTML IN HERE';
document.getElementById('declaration3').innerHTML = 'WRITE YOUR HTML IN HERE';
}
</script>
create some divs to receive the HTML form the javascript.
normally this elements are placed aright before the closing </body> tag,
<div id="declaration1"></div>
<div id="declaration2"></div>
<div id="declaration3"></div>
so what are we doing.
simple we have a function called injTrckPxls
this function needs to be called from the flash movie.
if not called no tracking will occurred.
when triggered the functiom will inject WHATEVER code you place in the innerHTML declaration
this could be iframe, and image, another div, or another javascript if so we desire.
we are tunneling thru the DOM via document once we are in document we search the innerHTML and we look for our declarations' ID via getElementByID once find it we write our own html snippet.
in the posters' case the correct way to place the conversion.js would be
document.getElementById('declaration3').innerHTML = '<script type="text/javascript" src="
so that when his flash button is clicked, the conversion.js is injected into the html page.
this approach can also be use to inject pixel tracking code that resides in a img src tag or in an iframe.
hope this helps someone facing the same issue, remember we are not experts, we are hobbist we a passion for coding.
Willronin