Skip to main content

How to Set Up Element Event Rules in Trackify X

Learn how to configure Element Event Rules in Trackify X to track custom shopper interactions on your Shopify storefront and send standard events to Facebook (Meta), TikTok, and Snapchat.

Written by Support

Overview

Element Event Rules is a feature available under Trackify X → Settings → Element event rules. It lets you track custom interactions on your Shopify storefront and send standard events to Facebook (Meta), TikTok, and Snapchat without writing custom tracking code.

For example, you can track clicks on a wishlist button, Contact Us link, newsletter signup button, or custom registration form.

Before you begin

Before configuring a rule:

  1. Open Shopify Admin → Online Store → Themes → Customize → App embeds.

  2. Enable the Trackify X app embed and save your theme.

  3. Make sure the advertising platform you want to use has a pixel configured in Trackify X.

Note: Element Event Rules work on your storefront pages. They do not run inside Shopify checkout.

How to create an Element Event Rule

Step 1: Open the settings

  1. Open Trackify X in your Shopify Admin.

  2. Navigate to Settings → Element event rules.

  3. Click Add rule.

You can configure up to 10 rules per store, including disabled rules.

Step 2: Choose how to match the element

Under Match by, choose one of the following options.

Class

Matches an element by its CSS class.

Example: wishlist-btn

Enter one class name only, without spaces.

ID

Matches an element by its HTML ID.

Example: contact-button

An ID generally identifies a specific element and is the most precise choice when it is unique on the page.

Tag name

Matches elements by their HTML tag.

Examples: button or a

Use this option carefully because it may match every element of that type across your storefront.

Link href

Matches a link by its destination.

Example: /pages/contact

The destination must match exactly, including query parameters after ?.

Step 3: Enter the element to match

Enter the class, ID, tag name, or link destination in the Element to match field.

You can include the . prefix for a class or the # prefix for an ID, or leave the prefix out.

How to find a class or ID:

  1. Open your storefront.

  2. Right-click the button or link you want to track.

  3. Select Inspect.

  4. Look for its class="..." or id="..." attribute.

If you are unsure which selector to use, contact your theme developer.

Step 4: Select the standard event

Under Standard event, choose the event you want Trackify X to send when the matched interaction occurs.

The available events are grouped into three categories in the dropdown.

Commerce

  • Page View (PageView)

  • View Content (ViewContent)

  • Add to Cart (AddToCart)

  • Initiate Checkout (InitiateCheckout)

  • Add Payment Info (AddPaymentInfo)

  • Purchase (Purchase)

  • Search (Search)

  • Add to Wishlist (AddToWishlist)

Leads and sign-ups

  • Complete Registration (CompleteRegistration)

  • Subscribe

  • Lead

  • Contact

  • Start Trial — Facebook only

  • Submit Application — Facebook only

Other

  • Customize Product — Facebook only

  • Donate — Facebook only

  • Find Location — Facebook only

  • Schedule — Facebook only

Platform availability is determined by the selected event. Trackify X automatically disables platforms that do not support the event you choose.

Important: Page View, View Content, Initiate Checkout, Add Payment Info, Purchase, and Search are already tracked by Trackify X. Creating additional rules for these events will not provide additional tracking.

Step 5: Choose the platforms

Under Send to, select the advertising platforms that should receive the event:

  • Facebook (Meta)

  • TikTok

  • Snapchat

Only supported platforms can be selected for the chosen event.

Step 6: Configure optional event values

You can optionally configure:

Event value: Assign a numeric value to the interaction. For example, you could assign a value of 5 to a newsletter signup.

Currency: Specify the currency associated with the event value. If left empty, Trackify X uses your store's currency.

Both fields are optional.

Step 7: Enable and save the rule

  • Enabled: Keep the checkbox selected to activate the rule. Uncheck it to pause the rule without deleting it.

  • Copy icon: Duplicate the rule to create a similar configuration.

  • Delete icon: Remove a rule you no longer need.

Click Save to apply your settings.

How Element Event Rules work

Once configured, a rule detects qualifying interactions with the selected element and sends the corresponding event to the selected advertising platforms.

Keep the following behavior in mind:

  • Every click counts: Clicking a wishlist button three times can generate three events.

  • Clicks on nested elements count: Clicking an icon or text inside a matched button can trigger the rule.

  • One click sends one event: Trackify X handles multiple browser signals associated with a single tap or click so they are counted as one interaction.

  • Shopper consent is respected: If your store displays a cookie banner, rules fire only for shoppers who accept tracking.

  • Overlapping rules can send duplicate events: If multiple rules match the same element and send the same event, the event may be sent more than once. Trackify X warns you when overlapping rules are detected.

  • Changes may take a few minutes: After saving, wait a few minutes, refresh your storefront, and test the interaction.

Special case: Add to Cart

Add to Cart works differently from other click-based events.

Trackify X waits until Shopify confirms that the product was successfully added to the cart. It then sends the event with the product details.

If your Add to Cart button is outside your theme's standard product form, add the following attribute to the button:

data-variant-id="VARIANT_ID"

Replace VARIANT_ID with the actual Shopify variant ID.

Important: Trackify X already tracks Add to Cart events. Adding an Element Event Rule for the same interaction can create a duplicate event. Use this rule only when necessary and verify your tracking setup carefully.

Special use case: Bundle, Sticky Add to Cart, and Gift Products

Some Shopify bundle apps, sticky Add to Cart buttons, and gift product features add multiple products to the cart through a single shopper interaction. In these cases, Trackify X may fire multiple AddToCart events, with a separate event for each product being added.

If you want to track the entire interaction as one AddToCart event instead of multiple events, you can use Element Event Rules to track the relevant bundle, sticky Add to Cart, or gift product button.

How it works

  1. Identify the CSS class or HTML ID of the button that adds the bundle, products, or gift items to the cart.

  2. Navigate to Trackify X → Settings → Element event rules and click Add rule.

  3. Select the appropriate matching method and enter the button's class or ID.

  4. Select Add to Cart (AddToCart) as the standard event.

  5. Choose the advertising platform you want to send the event to, enable the rule, and save it.

When the shopper clicks the matched button, the rule is designed to send one AddToCart event for that interaction, rather than a separate event for every product added through the interaction.

Recommended use cases

Element Event Rules are most useful for custom interactions that are not already tracked automatically.

Shopper interaction

Suggested event

Wishlist button

Add to Wishlist

Newsletter signup

Subscribe

Contact Us button

Contact

Lead form submission

Lead

Registration completion

Complete Registration

Starting a trial

Start Trial

Application submission

Submit Application

Product customization

Customize Product

Donation action

Donate

Store locator interaction

Find Location

Appointment booking

Schedule

Choose the event that best represents the action the shopper takes and check platform compatibility before saving.

Troubleshooting

My event is not appearing in the advertising platform.

Check that:

  1. The Trackify X app embed is enabled.

  2. The relevant pixel is configured in Trackify X.

  3. The rule is enabled and saved.

  4. The element selector matches the intended storefront element.

  5. The selected platform supports the chosen event.

  6. The shopper's consent settings permit tracking.

My event is firing multiple times.

Check for overlapping Element Event Rules and other tracking scripts or apps that may send the same event.

My button is not being detected.

Inspect the element and verify its class, ID, tag name, or link destination. Make sure the selector is correct and matches the intended element.

My Add to Cart event is duplicated.

Trackify X already tracks Add to Cart. Review any additional rules for the same action and remove unnecessary ones.

My rule is not firing inside checkout.

Element Event Rules work on storefront pages and do not run inside Shopify checkout.

Frequently asked questions

1. Do I need coding knowledge?

No. You can configure rules through Trackify X settings. However, identifying the correct HTML class or ID may require using your browser's Inspect tool or asking your developer for help.

2. How many rules can I create?

Up to 10 rules per store, including disabled rules.

3. Can I send an event to multiple platforms?

Yes, provided the selected platforms support the event.

4. Can I pause a rule without deleting it?

Yes. Uncheck Enabled to pause it.

5. Will every click trigger an event?

Every qualifying interaction can trigger an event. Repeated clicks may generate repeated events.

6. Does this replace existing Trackify X tracking?

No. Element Event Rules supplements existing tracking for custom storefront interactions. It does not replace the standard events already handled by Trackify X.

Did this answer your question?