I have created triggers for certain pages (url contains ‘/checkout/’) but it keeps firing
What steps have you taken to resolve the issue?
Hello,
is it correct that Triggers created in Zaraz fire multiple times?
I wanted to let it execute a custom HTML when visitors are on a certain page, but as it is triggered multiple times this causes issues.
You can see Trigger fired: Checkout repeated.
I attached my trigger setting in image.
Debug example:
Trigger fired: Pageview13:35:14
Trigger fired: Checkout13:35:14
Server-side network request: Google Analytics 413:35:14
Client-side network request: Google Analytics 413:35:14
Action called: Pageview from Google Analytics 413:35:14
Trigger fired: Checkout13:35:15
Server-side network request: Google Analytics 413:35:15
Client-side network request: Google Analytics 413:35:15
Action called: Checkout Started from Google Analytics 413:35:15
Trigger fired: All Tracks13:35:15
Trigger fired: Checkout13:35:15
Server-side network request: Google Analytics 413:35:15
Client-side network request: Google Analytics 413:35:15
Action called: All other events from Google Analytics 413:35:15
What are the steps to reproduce the issue?
I tried multiple variables, disabling some, and also different pages to see if it was checkout specific. It seems to be on multiple pages and setups.
I might have misunderstood the functionality of this. I thought you would be able to run a certain Zaraz script based on a certain trigger. But would Zaraz NOT have access to the relevant date? For example can it get variables from WooCommerce if triggered on a certain page, or would it not have access to this (and thus result in errors)?
The URL during your “Checkout” event is still “/checkout”, so the event is firing again. Just like the docs say: “If you create a trigger with match rules using variables from Page Properties, Cookies, Device Properties, or Miscellaneous categories, you will often want to add a second rule that matches Pageview. Otherwise, your trigger will be valid for every other event happening on this page too. Refer to Create a trigger to learn how to add more than one condition to a trigger.”
But would Zaraz NOT have access to the relevant date?
Unclear to me what does date have anything to do with this.
Thank you, I will add a second condition to prevent the triggers from loading multiple times. I was unaware of this.
My second questions appears to be unrelated. I was wondering if Zaraz even has the access to WooCommerce variables and whether it can execute a script that would get the variables; or that this should be done internally and then only read by Zaraz. Do you prefer me to open a different ticket for that?
I am trying to limit my plugins, so I wrote my own code in functions.php and this seems to be working quite well.
I use a logic that for example only executes certain parts on certain pages. For example it will read product information only on product pages.
Can I use Zaraz to execute this script only on product pages (using a variable)? I tried this before but it seems it caused some errors. I was wondering if this was because Zaraz might nog have access (rights) to read and access the necessary variables? Or would Zaraz have equal access as my current functions.php would have and can write and read?