Question:
Best workaround for Page Code’s lack of access to window.(DOM access). I receive the error “Cannot find name ‘window’”
Product:
Wix Studio
What are you trying to achieve:
I’m trying to submit this to Google
// Google Customer Reviews Opt-in Code
window.renderOptIn = function() {
window.gapi.load('surveyoptin', function() {
window.gapi.surveyoptin.render({
"merchant_id": ********,
"order_id": orderId,
"email": customerEmail,
"delivery_country": countryCode,
"estimated_delivery_date": estimatedDeliveryDate,
"opt_in_style": "BOTTOM_RIGHT_DIALOG"
});
});
};
What have you already tried:
Putting my code in Page and Custom code.
I’ve tried a lot of different ways to work around it.
- $w
- rendered Element
- wix-window-frontend Litebox
- Others I have since closed the tabs to
Additional information:
I want this code to run onCartCompleted or when the Thank-You page loads.