We’ve had many clients connect our module to Google Analytics (GA, sometimes also known as Omniture). Depending on the version of GA you have, you may already detect our events. If not, our modules support event callbacks that can initiate events that are tracked in GA.

Here’s an overview of how to use event callbacks for GA:

Event Handlers

Here are the event handlers that occur with the use of our module:

Note: Some event handlers have an e parameter, which gives you access to the native browser event object. See the installation section for example code.

Installation

The snippet shown below highlights the event callbacks for FindMine widgets. Each callback is optional and independent from one another.

For the onFinish event handler, we’ve included a call to GA4 (gtag) with an event called fm-finish. This assumes you’ve already defined fm-finish as an event in GA4. In this example, 'Category', 'Label', and 'Value' are placeholders. You'll need to replace them with values that make sense for your tracking needs. The 'Value' is optional and should be an integer.

window.onload = **function**() {
        window.FindMine.match({
                // Placeholder product
                application: '123',
                product_id: 'YXZ',
                return_pdp_item: **true**,
                event_handlers: {
                    onItemClick: **function**(e){ // Call to GA },
                    onPreviousLook: **function**(e){ // Call to GA },
                    onNextLook: **function**(e){ // Call to GA },
                    onFinish: **function**(){ 
											gtag('event', 'fm-finish', {
											     'event_category': 'Category',
											     'event_label': 'Label',
											     'value': '2' 
											});
									 }
                }
        });
};

You can use events like fm-finish as part of your overall funnel: for instance, to determine if your shopper viewed the FindMine widget and then added the product to cart and checked out. You could create other events tied to onItemClick that lets you understand if the shopper clicked on a Complete the Look item as part of their conversion journey.

Custom Modules

For more sophisticated integrations, FindMine can also build custom javascript modules that incorporate specific event handlers or other requirements. Contact us at [email protected] to learn more about this capability.