Which Date and Country Variables To Use When Integrating Google Customer Reviews

Updated on
Which Date and Country Variables To Use When Integrating Google Customer Reviews

When you are developing ecommerce websites, you may need to integrate Google Customer Reviews code. Google Customer Reviews enable ecommerce businesses to collect feedback from buyers and then show these ratings on the search results and search ads.

If you are going to embed Google Customer Reviews code in your BigCommerce website, you may not know which variables to use for the date “YYYY-MM-DD”.

For the “COUNTRY_CODE”, you will use “US” for United States and “MX” for Mexico (You will have to use ISO 3166-1 alpha-2 format. https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 You can use the below code to get date:
var d = new Date(%%LNG_DateOfOrder%%);
var curr_date = d.getDate();
var curr_month = d.getMonth();
var curr_year = d.getFullYear();
var formated_date = curr_year + "-" + curr_month + "-" + curr_date;

If you want to set the delivery date to be 7 days from the order placement date, you can add that no. of days to the variable curr-date

We are showing your code for 7 days ahead. The JS variable “DATE_TO_BE_USED” in the code is used for 7 days ahead. You can change it to any number of days, by simply changing the multiplier, i.e. 7, in this equation 86400 X 7 X 1000.

Updated on

Leave a comment

Please note, comments need to be approved before they are published.

Featured Service: Ecommerce Migration

Switching ecommerce platforms can feel overwhelming, but with Web Ecommerce Pros, it doesn’t have to be. Our Ecommerce Migration service ensures a seamless transition, moving your store’s products, customer data, and SEO rankings without downtime or lost functionality. Whether you're upgrading for better scalability, improved performance, or enhanced features, we handle the entire process—so you can focus on growing your business. From data transfer to design adjustments, we make sure your new platform is fully optimized and ready to sell. Let us take the hassle out of migration and get your store running smoothly on the right platform!