Analytics for CTA and Wishlist

This documentation provides a step-by-step guide to adding analytics for tracking clicks on Call-To-Actions (CTA) and Wishlist items within the Findify app for Shopify. This ensures you can monitor user interactions and gather valuable data for your store.

Step 1: Verify Existing Click Events

Findify may already be tracking clicks on Product Cards. To verify this:

  1. Open findify-product-card.js.
  2. Look for existing click event listeners, especially those related to CTAs and Wishlist buttons.
  3. Test by clicking on these elements and checking if events are triggered.

To test the events:

  1. Open your website in a browser.
  2. Right-click and select Inspect to open the Developer Tools.
  3. Go to the Network tab.
  4. Click on a Product Card, CTA, or Wishlist button.
  5. Look for a request similar to feedback?key= in the Network tab.

If you find the event, no further action is needed. If not, proceed to add custom events.

Step 2: Adding Custom Analytics Events

If click events are not being tracked for CTAs and Wishlist buttons, follow these steps to add the necessary analytics code.

In findify-product-card.js

  1. Locate the CTA and Wishlist button elements in your JavaScript file.
  2. Add event listeners to these elements to send analytics events when they are clicked. The method for adding analytics to CTAs and Wishlist buttons varies depending on the structure of these components. However, generally, you need to add the following code to track clicks on your CTAs and Wishlist buttons:
findify.core.analytics.sendEvent('click-item',
  {
      rid: findify.grid.state.meta.rid,
      item_id: id,
      variant_item_id: selectedVariantId
  },
  false
)

Step 3: Testing the Implementation

After adding the custom events:

  1. Open your website in a browser.
  2. Right-click and select Inspect to open the Developer Tools.
  3. Go to the Network tab.
  4. Click on the CTA and Wishlist buttons.
  5. Look for a request similar to feedback?key= in the Network tab.

You should see events being sent to Findify's analytics service.

For further assistance or inquiries, feel free to contact us on [email protected].