Question: In SLURM, I can easily specify the files for logging in my job script:

```
#SBATCH --output=logs/output-%j
#SBATCH --error=logs/error-%j

```

Now, I use a jobscript that is generated programmatically. Whenever I submit a job, I'd like to save that jobscript as `logs/jobscript-%j`.

**How could I do that?** (The main difficulty seems to be to get `%j`.)

Answer: 
I have researched the same question, and what I have found is that setting events to non-interactive affects session duration and bounce rates but has no affect on counting active users or sessions. This blog post from 2014 states this: <https://www.lunametrics.com/blog/2014/05/06/noninteraction-events-google-analytics/>

My suggested solution is that whenever the app goes to the background, set the tracker userId to a dummy value, such as "backgroundUser":

```
guard let tracker = GAI.sharedInstance().defaultTracker else { return }
tracker.set(kGAIUserId, value: "backgroundUser")

```

Then whenever the app returns to the foreground, set the userId back to the actual user's userID.

This will cause all foreground user-initiatated traffic to count for the correct users, and it will properly track the actual number of users actively using the app. All background activity will be attributed to the single dummy user. The session counts will still include all sessions, foreground and background.
To send a non-interaction event to GA using the iOS GA SDK, you would do this:

```
id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];

// Set non-interaction hit property
[tracker set: kGAINonInteraction
       value:@"1"];

// Send event
[tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"Test"
                                                      action:@"Test"
                                                       label:@"Test"
                                                       value:nil] build]];

```

P.S. I'm not very fluent with ObjectiveC so the syntax above may not be perfect but it should give you some idea.