Reputation: 6531
I'm trying to update Omniture variables so that they instantly show up when the debugger is called.\
For example I'd like prop12 to be set to "ggg" when a button on page is clicked.
$('#button').click(function(){
gs.prop12 = "ggg";
});
I have the SiteCatalyst.js file and there is no s but a gs object that contains all the variables, props ect.
But if I change or set the value, those changes don't show up in the debugger.
Any ideas?
Upvotes: 0
Views: 896
Reputation: 32532
Your latest comment:
So let me rephrase my question. Is there a way to make variable changes and send the request to Adobe via javascript? Ajax call perhaps so that it shows up in DigitalPulse immediately after making the changes?
Basically the way it works is you set variables and then make an s.t()
or s.tl()
call (or in your case, using gs
namespace), which are the "triggers" that send all your set variables to Adobe. So, yes. You can set variables to new values and then use one of the "triggers" to trigger another request to Adobe. However, not that this doesn't really replace previous values - it sends new values.
So for example if you set prop12
to "foo" and make a request, and then set prop12
to "bar" and make another request, you will see both "foo" and "bar" as separate entries in your reports. Also, once you make a s.tl()
or s.t()
call, you can refresh DigitalPulse and it will show a new entry, for the new request made to Adobe. Again, this doesn't replace the previous request - it submits an additional request, where data is aggregated in Adobe.
Now, there is an exception for some of the variables. For example, eVars (e.g. eVar1
) can be set within the Adobe Analytics interface to have the value overwritten with a new value for the duration of its scope (expiration time). So for example if you configure eVar1
to expire on visit and allocate it as most recent, then for the duration of the visit, the last value is what is shown for most metrics. However, one metric "instances" will still show all values sent.
So back to your example code. If you want to send a new value to Adobe after page load, on click of #button
, you'd do for example this:
$('#button').click(function(){
gs.linkTrackVars = "prop12";
gs.prop12 = "ggg";
gs.tl(true,"o","button click");
});
Couple of notes here:
tl()
calls) you must "register" the events and variables you want to include in the request. Since you are wanting to set prop12
, you must specify it in linkTrackVars
. If you were to also want to pop an event, you'd also make use of linkTrackEvents
. tl()
is used to make a "click" request to Adobe. A "click" request will record data but not count it as a page view ( t()
calls are made for page views, which is why it is in the base on-page coding when a page is loaded). In general, Adobe Analytics is a complex, enterprise level Analytics solution. I suggest you at least become intimate with the documentation about how it works in general, and if you can afford it, I recommend signing up for one or more of their training/certification courses.
Upvotes: 2