Suppose that the Activity Tree has two activities (Activity 1 and Activity 2). Activity 1's cmi.exit is set to empty characterstring by default and Activity 2's cmi.exit is set to "suspend" and "adl.nav.request" to "exitAll" and then Activity 2 calls Terminate(""). I want to know that whether the current information in the Run-Time Environment data model of Activity 2 is accessible in the next Sequencing Session or this data are discarded.
"exitAll" terminates the sequencing session without saving any data at all. So, the next sequencing session will start with fresh data. To be able to retrieve data in the next sequencing session, you need to call "suspendAll" instead. When "cmi.exit" is set to suspend, the current state of the suspended activity will be saved and will be available during the same sequencing session but it will not be available in the next sequening session unless you call "suspendAll".
Related
We only want to show our live chat tag Monday to Friday, from 09.00 until 17.00. Is this possible with Google Tag Manager please?
Thanks!
Preferred solution
The best solution is probably to get the current date on the server side and push to the datalayer a variable that determines whether the chat tag should be triggered or not depending on this date.
Alternative
The alternative is to retrieve the date on the client side which won't be 100% reliable. In order to use this solution, you need to create a Custom Javascript variable with the following code (replace "America/New_York" by your business' timezone) :
function (){
const currentDate = new Date(new Date().toLocaleString("en-US", {timeZone: "America/New_York"}));
const day = currentDate.getDay()
const hours = currentDate.getHours()
return day > 0 && day < 6 && hours >= 9 && hours < 17
}
Then, trigger your chat tag only when this variable's value is "true".
If you want to get a consistent, reliable date, ListenLayer.com returns a timestamp with every data dataLayer push. The time can appear in a single account timezone based on your account settings, so if you align your ListenLayer timezone to your chat time zone it will work.
You can then write rules in the platform to determine if the time returned should allow for chat. You will output a yes/no into a new data layer variable based on the rule. Then you will register this variable in GTM and use it to determine if the chat tag should fire.
Here is the process I would use at a high level
Create an account and set the account time to match your chat timezone
Turn on the User Source Listener and all it's features,
enable it to push on every page load This will push the user's traffic source into the data layer, along with a bunch of other structured data on each page load. You could use another listener, but this one will allow us to ensure it pushes on every page load (container load) so that GTM will know on every page load whether to trigger the chat script.
Create a custom data layer variable called chatTime. We will write a rule in ListenLayer to push a yes or a no into this variable based on the time that is returned in the userSource data layer event. This will happen in real time, in the same event in the data layer.
Publish everything in listenlayer and then go to your website with the console open (the data layer is written there for ease). You'll see the userSource dataLayer event in the console on every page load. It will contain an eventTimestamp. You want the data that is inside the listenlayerAccountTime node because it will match your ListenLayer timezone, which should match the timezone you operate your chat hours from (or if all of this is based on the user's time zone, use that one to be localized to them). You will need to focus on these two variables that are automatically provided because we will write a rule based on them in step 5:
sourceAutomaticValues.eventTimestamp.listenlayerAccountTime.time.timeOfDay
sourceAutomaticValues.eventTimestamp.listenlayerAccountTime.time.dayOfWeek
Here is a visual showing those variables I have given a path to above. One of the day of the week and one is the time of day.
Inside ListenLayer, under the User Source listener you will create two rules, they will be lookup table rules. The first rule will run first, then the second. If a match is found, they will stop. This means we can write the first rule to basically just look at the day of the week and set chatTime to no if the value is Sat or Sun. The second rule will then focus on the time of the day since this rule will only be reached if it is not Saturday or Sunday. In this rule we will look at the first part of the timeOfDay variable using simple ReGex. Our rule has 24 rows for each hour of the day and will return a yes only for the hours you are open for chat. Certainly this rule could be made simpler with some additional regex, but this gives a better illustration. There is an import export so you could spin up the 24 row rule in a csv file and import it.
After you save and publish this simple logic, your website will have a value in the data layer telling google tag manager whether chat should be on. It will appear in the data layer every time the userSource event is pushed, which is every page load.
I assume things are easy from here. You would create a data layer variable inside GTM referencing sourceCustomValues.chatTime You'll also create a custom event trigger referencing userSource and only firing if chatTime = yes. Then you will set your chat tag to fire on this trigger.
I'm having a problem regarding the scores in my game, My game is about answering questions using jumbled letters and when the player gets one correct answer, the game should add +1 to the game score and move to the next level (which is in the next room) and will generate another question, and keeping your last score which is 1. My problem is, the score just keeps on resetting to a value of 0 when moved into the next room. I want it to continuously add +1 even when I go to the next rooms. Thankyou in advance.
There are many solutions.
1) Set your score controller object as persistent
This is the best, as you don't need to do anything else, and in fact, it's a good rule to have one object as a persistent controller.
2) You can save your score to the file and load it each time this object (that stores the variable) is being created
This requires save\load manipulation, and in some cases (e.g you don't want to have ANY persistent objects) can be better, but I highly doubt.
You are not giving enough details about how are you storing the score value.
That may be cause by many issue in the way you are making the game, so im going to try to give all solutions to all possible scenarios:
1) Storing Score in Object Variable
This way may have two different sub scenarios:
a) Going to Next Room after Right answer
b) Restart the same room
This completly reset the variable on the object because the object is destroyed and then created again initilizing again the variables it hold when the room is created.
For this the solution is simply: set persistent true, you can do it from the form object properties (the interface that pop up when you open a object) or using gml on the create event of the object:
object: CREATE event
persistent = true;
This will make the object even if is repeated on the room created to no to create it again, so the event CREATE will no be never repeated again.
2) Storing the Score in variable of the room using Room Creation Event
In this scenario happeng the same that above, its just a local variable the room but exists only for the room and will only exists during the room until its restarted or leaved.
In this case the best is to transform this variable to a global instance in the following way:
global.points = 0;
And this is the best way to store score for you game.
Just remember no to put it in a create event of a not persistent object or it will be reseted to ZERO everything that object is created.
In that case you can check if the variable exists and then if not initializing it:
if (variable_global_exists("points") == true) {
global.points = 0;
}
Now if you want to save it you need to use file functions which is another question.
I'm running a query to pull source, medium, some custom dimensions, new sessions (totals.newVisits), sessions (totals.visits) and session duration (totals.timeOnSite).
I get some results where there is a value for totals.newVisits, but not totals.visits. How would that be possible - isn't a new visit supposed to be a subset of all visits?
You have to see these 2 variables ("totals.visits" and "totals.newVisits") as indicators (booleans).
Here, we want to know whether the user have already gone to the website before the visit or he is a returning visitor (totals.newVisits) and whether the user have done an interaction during the session or not (totals.visits).
In that case, it's 2 independent variables.
That is why Google specify these variables like :
The value is null if there are no interaction events in the session.
or
If this is the first visit, this value is 1, otherwise it is null.
You have to really stick into Google's variables definitions : BigQuery variable dictionary
From definition for totals.visits
The value is null if there are no interaction events in the session.
Added
Definition for totals.newVisits
If this is the first visit, this value is 1, otherwise it is null.
how can there be a value for newVisits if there are no interaction events?
I would interpret this as: New User visited page but there was no interaction
See more at BigQuery Export schema
I couldn't understand the usage of cmi.exit data model element.
Scenario A: Suppose an activity sets its cmi.success_status = passed and cmi.exit = suspend and then triggers an Exit All navigation request. In this case, what is the value of Objective Satisfied Status of the primary objective of the activity in the next Sequencing Session?
Scenario B: Suppose an activity sets its cmi.success_status = passed and cmi.exit = normal and then triggers an Exit All navigation request. In this case, what is the value of Objective Satisfied Status of the primary objective of the activity in the next Sequencing Session?
In both scenarios, the next sequencing session will start with fresh data because of "Exit All" NAV request. If a SCO sets the value of "cmi.exit" data to "suspend", this will suspend that SCO while the sequencing session is in progress. If you want to retain all data for the whole course, you should use "Suspend All" instead of "Exit All". Notice that "cmi.exit" is related only to the SCO which trigers it, it does not affect other SCOs in the course.
I'm creating a SharePoint 2010 application called HR Learning And Development. Basically it's an application to manage every employee trainings. Much like a college environment.
I have a SharePoint Lists named Training and Training Session. One training can have multiple sessions.
The Training Session lists have Trainer, Start-date and Status column among other things.
Employee who wants to enroll into this training would have to subscribe it.
The Training Session list should behave as follows :-
Status = New -> when a training session is just created
Status = In Progress -> when the Start-date > Date Time.Now
Status = Completed -> when the End-date <= Date Time.Now
Could you guys help me on how to solve this things.
Your help is very much appreciated.
Thanks
I would create a content type for the training session documents. Then either create a workflow for that list or for that content type, your preference. The workflow can be set to execute on both the creation and modification of a document. You can then do the time logic you specified within a workflow and update the status accordingly.