Hi,
I could do with some help editing the code snippet provided by Google to allow customers to opt-in to their Customer Reviews Programme.
The code is placed on the Order Confirmation page
The snippet is shown below and I have edited the easy parts but I can't seem to find the right variable for the customer invoice email address.
I have tried "BillEmailOnlineXML" but this give a blank field. I have also tried "ContactInvoiceEmail" but the result includes "Email : " and the email isn't formatted correctly, in plain text.
The other item I'm struggling with is "estimated_delivery_date". This has to be formatted as YYYY-MM-DD and I want the date to be the order date + 5 days.
<script src="https://apis.google.com/js/platform.js?onload=renderOptIn" async defer></script>
<script>
window.renderOptIn = function() {
window.gapi.load('surveyoptin', function() {
window.gapi.surveyoptin.render(
{
// REQUIRED FIELDS
"merchant_id": MY MERCHANT ID,
"order_id": "<actinic:variable name="TheOrderNumber" />",
"email": "<actinic:variable name="??????@??????.??.??" />",
"delivery_country": "GB",
"estimated_delivery_date": "TODAY'S DATE + 5 DAYS",
"opt_in_style": "CENTER_DIALOG"
});
});
}
window.___gcfg = {
lang: 'en_GB'
};
</script>
I'd be really grateful for any suggestions.
I could do with some help editing the code snippet provided by Google to allow customers to opt-in to their Customer Reviews Programme.
The code is placed on the Order Confirmation page
The snippet is shown below and I have edited the easy parts but I can't seem to find the right variable for the customer invoice email address.
I have tried "BillEmailOnlineXML" but this give a blank field. I have also tried "ContactInvoiceEmail" but the result includes "Email : " and the email isn't formatted correctly, in plain text.
The other item I'm struggling with is "estimated_delivery_date". This has to be formatted as YYYY-MM-DD and I want the date to be the order date + 5 days.
<script src="https://apis.google.com/js/platform.js?onload=renderOptIn" async defer></script>
<script>
window.renderOptIn = function() {
window.gapi.load('surveyoptin', function() {
window.gapi.surveyoptin.render(
{
// REQUIRED FIELDS
"merchant_id": MY MERCHANT ID,
"order_id": "<actinic:variable name="TheOrderNumber" />",
"email": "<actinic:variable name="??????@??????.??.??" />",
"delivery_country": "GB",
"estimated_delivery_date": "TODAY'S DATE + 5 DAYS",
"opt_in_style": "CENTER_DIALOG"
});
});
}
window.___gcfg = {
lang: 'en_GB'
};
</script>
I'd be really grateful for any suggestions.