This document provides instructions to add the MotoCommerce widgets to your dealership website.
This widget acts as a Call-to-Action (CTA) button to direct the customer into MotoCommerce for a specific inventory vehicle. You are free to style this CTA in a way that matches the design on your website.
1. Add the following script tag inside the head tag of every page where the widget will be used.
<script src="https://lauriahyundai.motocommerce.ca/integration/integration.js"></script>
2. Create an element that is like this one where you want the CTA to be displayed on the page:
<a href="#" class="motocommerce-vehicle-link" data-stock-id="880140">Build Your Deal</a>
The widget script will update the href to the correct url inside MotoCommerce once the page loads.
Your element must have these attributes:
Note: the "data-stock-id" attribute needs to be populated with the stock number or VIN number of the vehicle from inventory data source.
<a href="#" class="motocommerce-vehicle-link" data-stock-id="880140">Build Your Deal</a>
<a href="http://app.dealerdomain/conf/[some_custom_id]" class="motocommerce-vehicle-link" data-stock-id="880140">Build Your Deal</a>
<a href="#" class="motocommerce-vehicle-link" data-mc-page="vdp" data-stock-id="880140">Vehicle Details</a>
<a href="http://app.dealerdomain/details/[some_custom_id]" class="motocommerce-vehicle-link" data-mc-page="vdp" data-stock-id="880140">Vehicle Details</a>
If the attribute data-mc-page is not specified, we use the default page to create the CTA.
The default page is the Build your Deal page, but can be customized.
We can customize the copy for each CTA, so it will be updated when the widget is loaded.
By default, our widget uses your default language for the copies
If you want, you can change the default language for the entire page by adding a query parameter in the script:
<script src="https://lauriahyundai.motocommerce.ca/integration/integration.js?defaultLang=en-ca"></script>
You also can change the copies dynamically by calling MOTOINSIGHT.updateView('en-ca')
These are your available language options:
We use ITM parameters to track data inside Google Analytics.
By default, you don't need to change anything, we identify each parameter automatically.
However, there's one parameter that you may need to specify. itm_medium
There are two possible values for itm_medium:
We check the number of VINs loaded into the page to choose between the two values, but depending of how the dealer pages works (eg.: dynamically replace contents without reload the scripts) it's necessary to specify the itm_medium so it matches the current state.
To specify the itm_medium you can use the data-mc-medium attribute in the widget
<a href="#" class="motocommerce-vehicle-link" data-mc-medium="vdp" data-stock-id="880140">Build Your Deal</a>
If your page is built to dynamically load the Build Your Deal button widget or Login widget, then we recommend to run the function “MOTOINSIGHT.updateView()” to have our script parse your content as it loads. This will ensure that the proper MotoCommerce hyperlinks always gets generated and associated with the widgets as your page updates.
Example: call “MOTOINSIGHT.updateView()” if you have an infinite loader on your page, or if you populate HTML element attributes using some JavaScript code.