Page 1 of 1

Help with Code to get Variables for Third Party Platforms

Posted: Sat Jan 06, 2018 12:21 pm
by kwikstand
I have been trying to get variables such as customer email and name to populate for third part platforms such as Shopping Reviews and Remarketing. So far I've got things like Product Id and Order Number, but I still need the email and Name.

I am currently needing this on the Receipt.aspx page.

For example; here is the code required for ShopperApproved:

Code: Select all

<script type="text/javascript"> var sa_values = { "site":XXX, "token":"XXX", 'orderid':'ORDER123', 'name':'John Doe', 'email':'john.doe@gmail.com' }; function saLoadScript(src) { var js = window.document.createElement("script"); js.src = src; js.type = "text/javascript"; document.getElementsByTagName("head")[0].appendChild(js); } var d = new Date(); if (d.getTime() - 172800000 > 1477399567000) saLoadScript("//www.shopperapproved.com/thankyou/rate/26879.js"); else saLoadScript("//direct.shopperapproved.com/thankyou/rate/26879.js?d=" + d.getTime()); </script>
It is needing the 'orderid', 'name' and 'email'.

Adroll Remarketing also also needs the email in their code.

Any help with this would be appreciated. Thanks,

Scott

Re: Help with Code to get Variables for Third Party Platforms

Posted: Mon Jan 08, 2018 4:19 pm
by kwikstand
Is it "BillToEmail" that is needed to get the email address?

Re: Help with Code to get Variables for Third Party Platforms

Posted: Mon Jan 08, 2018 10:53 pm
by jmestep
Yes, it should be BillToEmail

Re: Help with Code to get Variables for Third Party Platforms

Posted: Tue Jan 09, 2018 1:49 am
by kwikstand
OK, thanks for that bit of info. What I need is the code to get that. I have been trying over and over using BillToEmail, but I crash the page. Does the Checkout/Receipt.aspx.cs need to be edited?

Thanks,

Scott

Re: Help with Code to get Variables for Third Party Platforms

Posted: Tue Jan 09, 2018 1:34 pm
by kwikstand
Here is the code Shopper Approved needs for Merchant Reviews the Receipt page:

Code: Select all

<script type="text/javascript"> var sa_values = { "site":26879, "token":"916h3sNg", 'orderid':'ORDER123', 'name':'John Doe', [color=#FF4000]'email'[/color]:'john.doe@gmail.com' }; function saLoadScript(src) { var js = window.document.createElement("script"); js.src = src; js.type = "text/javascript"; document.getElementsByTagName("head")[0].appendChild(js); } var d = new Date(); if (d.getTime() - 172800000 > 1477399567000) saLoadScript("//www.shopperapproved.com/thankyou/rate/26879.js"); else saLoadScript("//direct.shopperapproved.com/thankyou/rate/26879.js?d=" + d.getTime()); </script>
You can see they are looking for 'orderid', 'name' and 'email'

This is what they need for Product Reviews on the Product Page:

Code: Select all

<script type="text/javascript"> var sa_products_count = 3; var sa_date_format = 'F j, Y'; var sa_product = '[PRODUCT ID]'; (function(w,d,t,f,o,s,a){ o = 'shopperapproved'; if (!w[o]) { w[o] = function() { (w[o].arg = w[o].arg || []).push(arguments) }; s=d.createElement(t), a=d.getElementsByTagName(t)[0];s.async=1;s.src=f;a.parentNode.insertBefore(s,a)} })(window,document,'script','//www.shopperapproved.com/product/26879/'+sa_product+'.js'); </script> <div id="shopper_review_page"><div id="review_header"></div><div id="product_page"></div><div id="review_image"><a href="https://www.shopperapproved.com/reviews/contractors-solutions.net/" onclick="var nonwin=navigator.appName!='Microsoft Internet Explorer'?'yes':'no'; var certheight=screen.availHeight-90; window.open(this.href,'shopperapproved','location='+nonwin+',scrollbars=yes,width=620,height='+certheight+',menubar=no,toolbar=no'); return false;" target="_blank" rel="nofollow"></a></div></div>
Here on the Product Page, they need [PRODUCT ID]

Does any body know how to do this?

Any help would be greatly appreciated.