This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

GA4 Integration Question

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #54440
    danielschwindt_zjjcdanielschwindt_zjjc
    Participant

    I think I’ve pretty much got it all integration (GA4 and ASP) but one thing is confusing me on how it works:

    Here is the video version in case my typed message makes no sense: https://somup.com/cT1bYZLTra

    Basically I am getting data in my GA4 events for the search phrase that I didn’t configure, and I’m wondering where it is coming from.

    For example, if I type open my website and type “diagnostic” into my search bar, then go to my GA4 realtime events, I’ll see two entries:

    Phrase: diagnostic
    diagnostic

    I know where the second line is coming from, since I have the “Live search end event tracking” set to only contain “{phrase}” in the label. So far so good. But where is the “Phrase: diagnostic” one coming from? None of my plugin settings are configured to display “Phrase: {phrase}”.

    I notice that “Live search start event tracking” has that in its settings, but I have that one disabled on the toggle. Perhaps I have an issue where, even though that toggle is disabled, that event data is still being triggered somehow, such that each time I enter a search, I get the event I want (just the phrase) and then the one I don’t, “Phrase: {phrase}”?

    #54441
    danielschwindt_zjjcdanielschwindt_zjjc
    Participant

    I’ll also add that I’m getting those “Phrase: {phrase}” entries for every additional key that is pressed for a query. So if someone types “pt2448” I will get a whole list of events in GA4 for “pt” and “pt2” and then “pt24” “pt244” and so on. Definitely would like to turn that off if possible.

    #54444
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    Thanks for the video, that actually helped a lot.

    So in the video you are looking at an event called search_term. However that event is not coming from Ajax Search Pro. As you scrolled through the options on the back-end, the event names were the default: focus, search_start, search_end, magnifier etc..

    The event search_term seems to be a core GA4 analytics event parameter. I suspect it is triggered when you view the search results page, when the enhanced measurments are active.
    My guess is, that you should be able to test that by visiting the search results page with a couple of different phrases, they should start showing up under the search_terms event.

    #54445
    danielschwindt_zjjcdanielschwindt_zjjc
    Participant

    Hey Ernest, please take a look at this one and hopefully it will clarify: https://somup.com/cT1FlTLOdj

    It does give you a view in the GTM preview/debug window as to which asp_events are triggering and whether or not that is what should be happening. As I mention in the video, I know it isn’t in the scope of your support to setup my GA4/GTM but I’m wondering if the search_start event is being triggered incorrectly even though I have it disabled in my settings.

    #54446
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Oh, I’m sorry, I was confused and thought that was due to the results page.

    You are right, that shouldn’t be triggered. I quickly checked, and there seems to be a type coercion issue within the core script, I can replicate this.

    Long story short, the script checks if the option is disabled, and the option is sent as either a 0 (if disabled) or 1 (if enabled). However by mistake it’s converted to a string, therefore instead of 0 or 1 the value is “0” or “1”. And in javascript deals with that in a funny way, as 0 is coerced to a boolean false, but “0” is a boolean true – therefore it thinks the option is enabled.

    I will get back to you in an hour or so, I think I can patch this real quick and send you a beta copy to test.

    #54447
    danielschwindt_zjjcdanielschwindt_zjjc
    Participant

    Awesome! Thanks, great to hear. Not a huge rush but glad to have a fix when ready.

    #54448
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    #54450
    danielschwindt_zjjcdanielschwindt_zjjc
    Participant

    You got it, all fixed, only the events I toggled were fired.

    #54451
    danielschwindt_zjjcdanielschwindt_zjjc
    Participant

    So can I just leave this beta installed and then it’ll update as usual when the next version comes?

    #54452
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Perfect, thank you for the feedback.

    Yes, keep this one installed, I have already merged this bugfix to the upcoming release.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.