Forums

Yahoo conversion tracking code

versadial 26 Aug, 2009
Where should I place my Yahoo conversion tracking code?

This is my tracking code:

<SCRIPT language="JavaScript" type="text/javascript">
<!-- Yahoo! Inc.
window.ysm_customData = new Object();
window.ysm_customData.conversion = "transId=,currency=,amount=";
var ysm_accountid = "1GVJSDROJ4CLGCGC9VJJVN9QBV4";
document.write("<SCR" + "IPT language='JavaScript' type='text/javascript' "
+ "SRC=//" + "srv3.wa.marketingsolutions.yahoo.com" + "/script/ScriptServlet" + "?aid=" + ysm_accountid
+ "></SCR" + "IPT>");
// -->
</SCRIPT>
GreyHead 26 Aug, 2009
Hi versadial,

Try the JavaScript box - without the script tags. There's also a thread about this somewhere here.

Bob
versadial 26 Aug, 2009
That makes sense. I figured I would post the question before trying it live. Now all I need is a conversion in order to tell me it works. :wink:

Can I place the Bing JavaScript conversion code in that same area?
If so, what keeps them seperated if there are no script tags?
It looks like this:
<SCRIPT>
microsoft_adcenterconversion_domainid = 57725;
microsoft_adcenterconversion_cp = 5050;
</SCRIPT>
<SCRIPT SRC="https://0.r.msn.com/scripts/microsoft_adcenterconversion.js"></SCRIPT>
<NOSCRIPT><IMG width=1 height=1 SRC="https://57725.r.msn.com/?type=1&cp=1"/></NOSCRIPT><a href="http://advertising.msn.com/MSNadCenter/LearningCenter/adtracker.asp" target="_blank">::adCenter::</a>
GreyHead 27 Aug, 2009
Hi versadial,

Yes you can (at least the script parts). Personally I'd probably use a separate module to do this for me; or, in ChronoForms, I'd add the following to the Form HTML (not the JavaScript box)
<?php
$doc =& JFactory::getDocument();
$doc->addScriptDeclaration("microsoft_adcenterconversion_domainid = 57725;
microsoft_adcenterconversion_cp = 5050;");
$doc->addScript("https://0.r.msn.com/scripts/microsoft_adcenterconversion.js");
?>
<NOSCRIPT><IMG width=1 height=1 SRC="https://57725.r.msn.com/?type=1&cp=1"/></NOSCRIPT>
<a href="http://advertising.msn.com/MSNadCenter/LearningCenter/adtracker.asp" target="_blank">::adCenter::</a>

Bob
versadial 28 Aug, 2009
Thanks Bob. I appreciate your feedback.
I'll try that and as soon as I get some Bing conversions I'll know if it worked.
versadial 28 Aug, 2009
If I have multiple Yahoo accounts for the various regions of the world, how do I use my multiple sets of yahoo conversion code? Could I place them all in the Form JavaScript area? Is there a special way to combine these sets of code in this area?
GreyHead 29 Aug, 2009
Hi versadial,

How do you know whicn one to use? Or do you just load them all on every page?

I don't think that there is any reason why you can't add them all into the JavaScript box, it's just not very elegant code.

Bob
versadial 31 Aug, 2009
What do you mean by, "How do I know which one to use"? Which Yahoo conversion tracking javascript code? Each Yahoo account from each country has a different javascript code. I want to track ALL conversions even though they are reported seperately in the different country accounts.
GreyHead 31 Aug, 2009
Hi versadial,

So you show all the conversion codes on each page?

Bob
versadial 31 Aug, 2009
No, I'm only using the conversion codes on the forms. When someone fills out the form it counts as a conversion and the conversion is recorded because of the JavaScript conversion code I place in the "Form code-Form HTML" area of Chronoforms admin.
versadial 04 Sep, 2009
So, if I am using the same form for several countries, how should I combine all the javascript codes for my different Yahoo accounts into the form javascript area?
GreyHead 04 Sep, 2009
Hi versadial,

I don't think that there is any reason why you can't add them all into the JavaScript box, it's just not very elegant code.


Bob
versadial 04 Sep, 2009
I'm not a big Javascript guy so i wasn't sure how to combine them to be accepted in Chronoforms. I also wasn't aware of any other way to go about it.
GreyHead 05 Sep, 2009
Hi versadial,

I don't know what needs to be combined. Show me the code for 2 or 3 and, if I have time, I'll try to combine them for you.

Bob
versadial 08 Sep, 2009
Kewl, thanks Bob. Here's the four regions.

USA:
<SCRIPT language="JavaScript" type="text/javascript">
<!-- Yahoo! Inc.
window.ysm_customData = new Object();
window.ysm_customData.conversion = "transId=,currency=,amount=";
var ysm_accountid = "1GVJSDROJ4CLGCGC9VJJVN9QBV4";
document.write("<SCR" + "IPT language='JavaScript' type='text/javascript' "
+ "SRC=//" + "srv3.wa.marketingsolutions.yahoo.com" + "/script/ScriptServlet" + "?aid=" + ysm_accountid
+ "></SCR" + "IPT>");
// -->
</SCRIPT>

Australia:
<SCRIPT language="JavaScript" type="text/javascript">
<!-- Yahoo! Search Marketing Australia & NZ
window.ysm_customData = new Object();
window.ysm_customData.conversion = "transId=,currency=,amount=";
var ysm_accountid = "12JS86J4UJO12J039QC19BHG1EK";
document.write("<SCR" + "IPT language='JavaScript' type='text/javascript' "
+ "SRC=//" + "srv3.wa.marketingsolutions.yahoo.com" + "/script/ScriptServlet" + "?aid=" + ysm_accountid
+ "></SCR" + "IPT>");
// -->
</SCRIPT>

Brazil:
<SCRIPT language="JavaScript" type="text/javascript">
<!-- Yahoo! do Brasil Internet Ltda.
window.ysm_customData = new Object();
window.ysm_customData.conversion = "transId=,currency=,amount=";
var ysm_accountid = "1CA0EIQKOUP2BT799L15FRIEDLG";
document.write("<SCR" + "IPT language='JavaScript' type='text/javascript' "
+ "SRC=//" + "srv2.wa.marketingsolutions.yahoo.com" + "/script/ScriptServlet" + "?aid=" + ysm_accountid
+ "></SCR" + "IPT>");
// -->
</SCRIPT>

UK:
<SCRIPT language="JavaScript" type="text/javascript">
<!-- Yahoo!
window.ysm_customData = new Object();
window.ysm_customData.conversion = "transId=,currency=,amount=";
var ysm_accountid = "14KT33C47O7727SNIPPASFIBFNC";
document.write("<SCR" + "IPT language='JavaScript' type='text/javascript' "
+ "SRC=//" + "srv3.wa.marketingsolutions.yahoo.com" + "/script/ScriptServlet" + "?aid=" + ysm_accountid
+ "></SCR" + "IPT>");
// -->
</SCRIPT>
GreyHead 08 Sep, 2009
Hi versadial,

I guess that I'd add them to the form html to get them to load in the page header
<?php
$script = "
<!-- Yahoo! Inc.
window.ysm_customData_1 = new Object();
window.ysm_customData_1.conversion = "transId=,currency=,amount=";
var ysm_accountid_1 = "1GVJSDROJ4CLGCGC9VJJVN9QBV4";
document.write("<SCR" + "IPT language='JavaScript' type='text/javascript' "
+ "SRC=//" + "srv3.wa.marketingsolutions.yahoo.com" + "/script/ScriptServlet" + "?aid=" + ysm_accountid_1
+ "></SCR" + "IPT>");
// -->
<!-- Yahoo! Search Marketing Australia & NZ
window.ysm_customData_2 = new Object();
window.ysm_customData_2.conversion = "transId=,currency=,amount=";
var ysm_accountid_2 = "12JS86J4UJO12J039QC19BHG1EK";
document.write("<SCR" + "IPT language='JavaScript' type='text/javascript' "
+ "SRC=//" + "srv3.wa.marketingsolutions.yahoo.com" + "/script/ScriptServlet" + "?aid=" + ysm_accountid_2
+ "></SCR" + "IPT>");
// -->
<!-- Yahoo! do Brasil Internet Ltda.
window.ysm_customData_3 = new Object();
window.ysm_customData_3.conversion = "transId=,currency=,amount=";
var ysm_accountid_3 = "1CA0EIQKOUP2BT799L15FRIEDLG";
document.write("<SCR" + "IPT language='JavaScript' type='text/javascript' "
+ "SRC=//" + "srv2.wa.marketingsolutions.yahoo.com" + "/script/ScriptServlet" + "?aid=" + ysm_accountid_3
+ "></SCR" + "IPT>");
// -->
<!-- Yahoo!
window.ysm_customData_4 = new Object();
window.ysm_customData_4.conversion = "transId=,currency=,amount=";
var ysm_accountid_4 = "14KT33C47O7727SNIPPASFIBFNC";
document.write("<SCR" + "IPT language='JavaScript' type='text/javascript' "
+ "SRC=//" + "srv3.wa.marketingsolutions.yahoo.com" + "/script/ScriptServlet" + "?aid=" + ysm_accountid_4
+ "></SCR" + "IPT>");
// -->
";
$doc =& JFactory::getDocument();
$doc->addScriptDeclaration($script);
?>
I don't know enough about the Yahoo process to knwo if changing the object names form ysm_customData to ysm_customData_1 etc will affect the process. You'll need to check that and, if necessary, ask Yahoo.

Bob

PS All four scripts are identical apart from the accoutn ids - I'm still a bit surprised that one universal code won't work everywhere.
versadial 10 Sep, 2009
Any ideas on how to best combine/optimize the aforementioned scripts?
versadial 10 Sep, 2009
Ah, sorry, I missed your previous post. I'll give that a try. Thanks again.
This topic is locked and no more replies can be posted.