Title: Possible wrong tag
Last modified: August 16, 2019

---

# Possible wrong tag

 *  [atman1](https://wordpress.org/support/users/atman1/)
 * (@atman1)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/possible-wrong-tag/)
 * Recently some of our customers received tags (and AC automations) reserved for
   products they didn’t buy.
 * The only way to get the tag that we know of is to complete the purchase on our
   website and get the tag added through WC-AC Hook.
 * And yet, mysteriously, that tag started showing up in the last 2 weeks without
   people buying actual product.
 * AC support told us that they can’t see any action within AC that would mistakenly
   add the tag and is pointing at your plugin.
 * Could you help us troubleshoot this issue?

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [mtreherne](https://wordpress.org/support/users/mtreherne/)
 * (@mtreherne)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/possible-wrong-tag/#post-11838833)
 * Hi there,
 * The starting point is to look at the debug log for orders related to a particular
   customer/contact. If you haven’t already then please enable logging in the settings(
   you will have to wait for the next problem before we can investigate further).
 * If debug logging is enabled already, then find the order(s) in the debug log 
   and cut and paste the entries into the forum so that I can see the times, order
   references and status changes.
 * Thanks,
    Matthew.
 *  Thread Starter [atman1](https://wordpress.org/support/users/atman1/)
 * (@atman1)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/possible-wrong-tag/#post-11888270)
 * Debug log for the 1st of september 2019 r.
 * 09-01-2019 @ 12:14:57 – Order ID = 25753 (Status = pending). Contact synced successfully(
   ActiveCampaign ID = 69720)
    09-01-2019 @ 12:15:08 – Order ID = 25753 (Status 
   = completed). Contact synced successfully (ActiveCampaign ID = 69720) 09-01-2019
   @ 12:46:08 – Order ID = 25754 (Status = pending). Contact synced successfully(
   ActiveCampaign ID = 9953) 09-01-2019 @ 13:11:59 – Order ID = 25755 (Status = 
   pending). Contact synced successfully (ActiveCampaign ID = 69910) 09-01-2019 
   @ 13:13:19 – Order ID = 25755 (Status = completed). Contact synced successfully(
   ActiveCampaign ID = 69910) 09-01-2019 @ 16:43:53 – Order ID = 25757 (Status =
   pending). Contact synced successfully (ActiveCampaign ID = 69567)
 * I checked completed orders. None had bought product “A”, but still got a tag 
   only for ppl who had.
 * I’m not sure if this is everything you needed.
 *  Plugin Author [mtreherne](https://wordpress.org/support/users/mtreherne/)
 * (@mtreherne)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/possible-wrong-tag/#post-11888488)
 * Thanks – I’ll need more but this is what I need to start with.
 * Firstly can you confirm which is the ActiveCampaign ID for the contact (the one
   which has the unexpected product tag)? The log has four contacts listed 69720,
   9953, 69910 and 69567? To help, when you are looking at a contact in ActiveCampaign
   the ID will be in the URL e.g.
 * [https://youractivecampaigndomain/app/contacts/69720](https://youractivecampaigndomain/app/contacts/69720)
 * For the contact selected, please can you create a list of all the order numbers
   for that customer so that we can compile a list of all the tags for the products
   that they have purchased. Maybe (hopefully to keep it simple) the contact only
   has one order (i.e. the order ID shown in the log above). But if there have been
   other orders in the past then please find them all.
 * The easiest way to find orders for the same contact is to ‘Search orders’ from
   WP admin screen (WooCommerce > Orders menu) and enter the email address of the
   contact.
 * Once you have a list of all orders for the contact, go through the orders and
   compile a list of all the products on each order. Then go through each product
   and cut and paste the whole ‘ActiveCampaign Tag’ field from the Advanced Product
   data field to this forum for each product (and show the order id for my reference).
 * Can you let me know the Default Tag(s) from the WC-AC Hook settings on WordPress(
   under WooCommerce > Settings > Integration).
 * Finally can you give me a list of all the tags for the contact on ActiveCampaign.
 * Thanks,
    Matthew
 *  Thread Starter [atman1](https://wordpress.org/support/users/atman1/)
 * (@atman1)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/possible-wrong-tag/#post-11891415)
 * AC contact id: 69720
 * – Order id: #25753
    — AC product tag: aktywny-angielski-praktyk – Contact tags:
   akcelerator-jezykowy, aktywny-angielski-OTO, aktywny-angielski-potwierdzil, aktywny-
   angielski-praktyk, aktywny-angielski-starter, ascending, back-end, chce-angielski,
   chce-jezyki, core-offer, Engaged, klient (completed), kurs-online, nauka-jezykow,
   new-contact
 * AC contact id: 69910
 * – Order id: #25759
    — AC prod tag: aktywny-angielski-praktyk – Order id: #25755—
   AC prod tag: lodolamacz-jezykowy – Contact tags: akcelerator-jezykowy, aktywny-
   angielski-praktyk, ascending, back-end, chce-jezyki, core-offer, Engaged, klient(
   completed), kurs-online, lodolamacz-jezykowy, nauka-jezykow
 * The tag “akcelerator-jezykowy” is the one that shouldn’t have been added, because
   these customers didn’t buy the appriopriate course.
 * The default WC-AC Hook tag is: klient
    -  This reply was modified 6 years, 9 months ago by [atman1](https://wordpress.org/support/users/atman1/).
 *  Plugin Author [mtreherne](https://wordpress.org/support/users/mtreherne/)
 * (@mtreherne)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/possible-wrong-tag/#post-11891829)
 * Ok thanks. I have a few more questions. Apologies for this taking some time. 
   Because ActiveCampaign does not record how or when a tag was added to a contact
   it is not straightforward to investigate.
 * When you see the error (i.e. a product tag for a product that the customer did
   NOT buy), is it always for products with the tag ‘akcelerator-jezykowy’ or have
   you seen other examples?
 * Have all the errors (not just the two above) included orders with the product
   tag ‘aktywny-angielski-praktyk’?
 * Can you double check one thing by logging into WP admin and going to the product‘
   ActiveCampaign Tag’ field from the Advanced Product data field for the product
   with the tag ‘aktywny-angielski-praktyk’ (if there are multiple products with
   this tag please check the specific one on the orders you have identified). I 
   don’t know which browser you use (so this may not work exactly as follows), but
   I would like you to select the ‘ActiveCampaign Tag’ input field, then right click
   to ‘inspect’ the element to check that the HTML includes value=”aktywny-angielski-
   praktyk” exactly. It is very unlikely that any erroneous characters have been
   attached or hidden in the field, but let’s check anyway.
 * My thinking is that there are few ways a tag could have been added to a contact:
 * 1) By WC-AC Hook plugin
    2) Manually on ActiveCampaign 3) By an ActiveCampaign
   automation 4) By an ActiveCampaign form
 * The only way to confirm the the plugin has added the tag is for me to release
   a new version of the plugin to you with enhanced logging so that the actual tags
   sent to ActiveCampaign are also recorded in the log. This will confirm the problem
   is with the plugin, and hopefully clarify the cause. Depending on your answers
   to the questions above, I will set this up and send details through to you so
   that you can install.
 * The only other thing I can think of asking you to check is to go through any 
   AC automations and forms that have been triggered on the contacts, to ensure 
   that there is no way the product tags could have been added by them.
 * Thanks,
    Matthew
 *  Thread Starter [atman1](https://wordpress.org/support/users/atman1/)
 * (@atman1)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/possible-wrong-tag/#post-11892487)
 * 1. The issue is only associated with the tag “akcelerator-jezykowy”
 * 2. Not all the errors include “aktywny-angielski-starter”. At first I also thought
   that was the case, but after checking more orders (without “aktywny-angielski-
   starter”) I noticed that they also contain additional tag “akcelerator-jezykowy”(
   even though they didn’t buy the course).
 * 3. After inspecting the code I didn’t find and erroneous characters attatched
   to the tag field.
 * 4. We’ve checked our automations to see if the tag “akcelerator-angielski” is
   added by some mistake, but we didn’t find anything. Additionally this issue started
   happening just a few weeks ago. Until then this error hadn’t been occuring.
    
   We’ve also checked AC action history of a few customers and didn’t find any indication
   of AC adding this erroneous tag.
 *  Plugin Author [mtreherne](https://wordpress.org/support/users/mtreherne/)
 * (@mtreherne)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/possible-wrong-tag/#post-11892934)
 * Ok when I get a moment later today or tomorrow, I’ll prepare a new branch of 
   the code and send details to you.
 * With respect to your point 2 above, I was thinking the common denominator might
   be the ‘aktywny-angielski-praktyk’ product tag rather than the ‘aktywny-angielski-
   starter’ tag as it was on both order 25753 and 25759.
 * I’ll get back to you,
    Matt
 *  Plugin Author [mtreherne](https://wordpress.org/support/users/mtreherne/)
 * (@mtreherne)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/possible-wrong-tag/#post-11899430)
 * Ok I have create a new branch of the plugin so that you can debug this problem.
 * I have created a new version of the plugin (in a branch called ‘logtags’) with
   one file updated.
 * [https://plugins.trac.wordpress.org/browser/wc-ac-hook/branches/logtags](https://plugins.trac.wordpress.org/browser/wc-ac-hook/branches/logtags)
 * This is not a public release (you won’t get notified to install from wp-admin),
   so you must install using whichever method suits you i.e. FTP or your site control
   panel or SSH or SVN. If you need any guidance then get back to me.
 * There is only one file that actually needs to be updated. The file name is sync-
   contact.php (you can simply download this, save your old version and replace).
   To download the updated file follow the link below scroll down and select ‘Download
   in other formats: Original Format’.
 * [https://plugins.trac.wordpress.org/browser/wc-ac-hook/branches/logtags/includes/sync-contact.php](https://plugins.trac.wordpress.org/browser/wc-ac-hook/branches/logtags/includes/sync-contact.php)
 * The file should replace (with same ownership and permissions) the one in the 
   WP installation of your site in the folder: wp-content/plugins/wc-ac-hook/includes
 * When you replace the file that you have installed on your site the plugin will
   work exactly as before but will log details of the tags added to any contact.
   You will need to wait for the problem to occur again so that you can check the
   debug logs.
 * Regards,
    Matt

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Possible wrong tag’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wc-ac-hook.svg)
 * [WC-AC Hook](https://wordpress.org/plugins/wc-ac-hook/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wc-ac-hook/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wc-ac-hook/)
 * [Active Topics](https://wordpress.org/support/plugin/wc-ac-hook/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wc-ac-hook/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wc-ac-hook/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [mtreherne](https://wordpress.org/support/users/mtreherne/)
 * Last activity: [6 years, 9 months ago](https://wordpress.org/support/topic/possible-wrong-tag/#post-11899430)
 * Status: not resolved