3

I'm using Google's Model Viewer in my project, and unfortunately, it is treating certain events as non-interaction: false when they should be non-interaction: true. In my case, these are the events that fire when the model loads, when it detects a user with AR support, and when it detects a user with QR support.

How can I manually set the non-interaction values of these events to true? I've attempted solutions similar to this to no avail:

export type AnalyticsEvent = {
  type: string;
  category: string;
  action: string;
  label: string;
  value: number;
  nonInteraction: boolean;
};
export const USER_WITH_AR_SUPPORT_TEMPLATE: AnalyticsEvent = {
  type: 'event',
  category: AR_CATEGORY,
  action: 'UserWithArSupport',
  label: '',
  value: '',
  nonInteraction: true,
};
"kind": "javascript-module",
"path": "src/globals/ArEvents.ts",
"declarations": [
  {
    "kind": "variable",
    "name": "userWithArSupportTemplate",
    "type": {
      "text": "AnalyticsEvent"
    },
    "default": "{\n  type: 'event',\n  category: ARCategory,\n  action: 'UserWithArSupport',\n  label: '',\n ,\n nonInteraction: true}"
  },

I've also attempted the solution here, as well as several similar ones. Am I using the wrong variable name or index for non-interaction?

Added more code as requested

public sendGaEvent(uaCode: string, eventData: AnalyticsEvent, sku: string, log: boolean) {
    ...
    const instance = this[$analyticsMap].get(uaCode);
    const tracker = instance!.tracker;
    if (!tracker) {
      const queue = instance!.queue;
      queue!.enqueue(eventData);

      LoggerInstance.log({
        sender: this,
        message: 'Enqueuing GA event',
        force: log
      });
    } else {
      ga(`${tracker}.send`, 
        eventData.type,
        eventData.category,
        eventData.action,
        eventData.label,
        eventData.nonInteraction,
        {
          hitCallback: () => LoggerInstance.log({
            sender: this,
            message: 'GA event successfully sent!',
            objectToLog: eventData,
            force: log
          })
        }
      );

      LoggerInstance.log({
        sender: this,
        message: 'Sending GA event',
        force: log
      });
    }
    ...
}

EDIT: Using @d-_-b's suggestion, I found the proper form of the solution to be passing in nonInteraction as an object as follows:

ga(
   'send', 
   'event', 
   'AR_CATEGORY', 
   'UserWithArSupport', 
   'label', 
   {'nonInteraction': true}
);

It is evidently important to keep the quotes around the name 'nonInteraction' when passing it in as an object

Cameron Crane
  • 113
  • 1
  • 12
  • What does your javascript look like? I see some JSON data but don't see the full value of how you're using their Javascript SDK. Also, are you using GA4? or Universal Analytics? – d-_-b Aug 16 '22 at 02:03
  • @d-_-b What specifically from my JS do you need to see? I am currently using Universal Analytics – Cameron Crane Aug 16 '22 at 18:19
  • 1
    If you share the javascript used to log the event, it'll be easier to tell you what needs to be changed and how you might be calling it incorrectly. – d-_-b Aug 16 '22 at 21:21
  • @d-_-b My apologies for the late response, was out of the office. I believe I added the section of code that you requested, let me know if you need any more info – Cameron Crane Aug 22 '22 at 14:31

1 Answers1

3

For Universal Analytics, the nonInteraction property should be passed as an object (see docs):

ga('send', 'event', 'AR_CATEGORY', 'UserWithArSupport', 'label', {
  nonInteraction: true
});

If you're using gtag.js, you need to add non_interaction: true as documented here

 gtag('event', '<event-name>', {
   'event_label': '',
   'event_category': 'AR_CATEGORY',
   'event_action': 'UserWithArSupport',
   'non_interaction': true
 }); 
d-_-b
  • 21,536
  • 40
  • 150
  • 256
  • Unfortunately I am using UA not gTag – Cameron Crane Aug 22 '22 at 14:31
  • @CameronCrane just updated with the `ga` version – d-_-b Aug 23 '22 at 03:05
  • I've attempted both of these solutions and still seem to be getting a 0% bounce rate. Could there be something else that's effecting this? – Cameron Crane Aug 30 '22 at 20:42
  • If you have any other events being triggered within that session that aren't set as non-interaction that could explain zero bounce rate. – d-_-b Aug 31 '22 at 00:18
  • 1
    Gotcha! Setting the rest of my events to non_interaction: true seems to consistently get me a non-zero bounce rate, but it quickly changes to 0 after a few minutes. I don't believe any other events are firing in this time. What else could be causing this? Also selecting this as the answer, as it answered the original question :) Thanks! – Cameron Crane Aug 31 '22 at 14:30