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:
- Open
findify-product-card.js
. - Look for existing click event listeners, especially those related to CTAs and Wishlist buttons.
- Test by clicking on these elements and checking if events are triggered.
To test the events:
- Open your website in a browser.
- Right-click and select Inspect to open the Developer Tools.
- Go to the Network tab.
- Click on a Product Card, CTA, or Wishlist button.
- 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
findify-product-card.js
- Locate the CTA and Wishlist button elements in your JavaScript file.
- 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:
- Open your website in a browser.
- Right-click and select Inspect to open the Developer Tools.
- Go to the Network tab.
- Click on the CTA and Wishlist buttons.
- 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].
Updated 3 months ago