How to dynamically pass a variable to a 3rd party tracking pixel

2.6k views Asked by At

Here is what I'm dealing with. I require a way to dynamically pass a variable or value (sale amount and order id) to a 3rd party tracking pixel for my cost per sale campaign as I am using affiliate marketing. I cannot get help from Intuit who I used to design and host my site. My affiliate marketing support sent this... Just tell them you need to “dynamically pass sale amount and order ID through a 3rd party tracking pixel.” They should come back with a syntax for you to add to the code. It might be something like <order.number> or “<orderamount>” . . . . So basically, I have the code on the confirmation page, but don't know how to dynamically pass the amount and order id so that the proper commission can be paid. Please help. Thanks. :confused:

Here is the code:

<script language="JavaScript" src="https://www.linkconnector.com/tmjs.php?lc=000000002852&oid=&amt="></script>
3

There are 3 answers

2
Gabriel S. On

Did they pass this exact structure to you ?

When you finish your transaction, from where do you have access to the order ID and amount ? If you access those variable via PHP, you just have to include the URL contained in your structure with the proper variables. If you access those variable via JavaScript, you might insert a 1x1 transparent image with the src set to this URL, with proper variables...

Does that help you ? If not please specify how do you access your parameters.

0
Sakthi On

Why don't you try to pass the value by using Ajax?

0
Martinomagnifico On

I usually use document.write

    var MyLC = put your LC here;var MyOID = put your OID here;var MyAMT = put your amount here;
    document.write(" <scr"+"ipt src=\"\/\/www.linkconnector.com/tmjs.php?lc="+MyLC+"&oid="+MyOID+"&amt="+MyAMT+"\"><\/script>");

Put this in an <iframe>, so that the loading of the script doesn't hold up the loading of the rest of the page. (When the external server times out, for example)