I'm setting s.campaign in DTM (AppMeasurement) in a page load rule and have a couple of events that fire when a user starts/completes an online application. According to this article (https://marketing.adobe.com/resources/help/en_US/sc/implement/campaign.html), "Each campaign value remains active for a user, and receives credit for that user's activities and success events until it expires."
In my implementation, the s_campaign
cookie set by s.getValOnce()
is present when the events fire, but the Campaign Tracking Code report is not showing the events metrics giving credit to the campaign variable.
Here's my Custom Page Code in Page Load Rule:
/*
* Plugin: getValOnce_v1.11
*/
s.getValOnce=new Function("v","c","e","t",""
+"var s=this,a=new Date,v=v?v:'',c=c?c:'s_gvo',e=e?e:0,i=t=='m'?6000"
+"0:86400000,k=s.c_r(c);if(v){a.setTime(a.getTime()+e*i);s.c_w(c,v,e"
+"==0?0:a);}return v==k?'':v");
/* External Campaign Tracking */
if (s.Util.getQueryParam('cid')) {
s.campaign = s.Util.getQueryParam('cid');
s.campaign = s.getValOnce(s.campaign,'s_campaign',0);
}
Solved! Go to Solution.
Is the company going to continue using metrics.mydomain.com and smetrics.mydomain.com? If yes, then I would recommend to change your appmeasurement code to the following:
s_account = "reportsuiteid" //assuming these are the same across both codes
s.visitorNamespace = "" //should be the same for both codes
s.trackingServer = "metrics.yourdomain.com" //should be the same for both codes
s.trackingServerSecure = "smetrics.domain.com" //should be the same for both codes
If you have different values, you will have new visitors being registered and hence your s.campaign is not being set.
Views
Replies
Total Likes
I've moved this to the Analytics community since it is primarily focused on the s.campaign variable and it's attribution rather than the actual deployment through DTM.
To add more context to my original problem above, here is an image of my reporting.
1. represents a dev environment where I'm using legacy Omniture H.26 s_code. You can see that while s.campaign is set, it's crediting "source_test_snap_9:23AM" Tracking Code with event "Applications Started".
2. - 6. represent migrating over to AppMeasurement via DTM. Here I'm setting s.campaign using getValOnce, but no credit is given to the Tracking Codes from the events Applications Started/Applications Completed.
Views
Replies
Total Likes
Hi there,
It could be because the plugin, getValOnce is no longer supported by the appmeasurement code.
AppMeasurement Plug-in Support
What are you trying to achieve with the getValOnce plugin? And is your main goal just to get your cid to stick to the s.campaign?
/Waqas
Views
Replies
Total Likes
Web Analytics Ninja_2 Thanks for the reply. Yes, the main goal is to get cid to stick to s.campaign. getValOnce sets the cookie s_campaign with the value of the tracking code for the remainder of the users session. Also, if the user hits the browser back button, it prevents the tracking code from being submitted again. getValOnce is working properly in my implementation. According to the link you provided, "The following plug-ins should continue to work since the underlying functionality is still supported". The reason I'm using it is because after trying to use DTM's page load rule where you set s.campaign and parameter in the UI, it's not giving credit to tracking codes when an event is firing, so I'm trying to replicate what was working in my old Omniture H.26 implementation.
Views
Replies
Total Likes
Hi again,
Just replying from my phone so not the most optional way to communicate, but hope it works.
S.campaign is a persistent variable that sticks to the session until the session ends. You just need to set it once and with the getQueryParam method. And I would probably move the plugin and the tracking code in the library code area of the tool, so that you fire off s.campaign with the other tracking points defined in there.
Its late here in London, but feel free to pm me and we can chat about the best dtm approch for s.campaign in there during tomorrow.
/Waqas
Views
Replies
Total Likes
Dear Haddin,
Are you using 'Clear Vars' anywhere after capturing the s.campaign value? I hope there is a gap in implementation.
Thank You
Arun
Views
Replies
Total Likes
And please look at this url:
https://marketing.adobe.com/resources/help/en_US/sc/implement/getValOnce.html
And this section:
Note: If your organization uses Marketing Channels and has rules set up based on
s.campaign
, it is recommended that you not use the getValOnce plugin when setting the
s.campaign
value. Doing so could lead to an incorrect channel being assigned on a secondary campaign click-through.
If I was you, I would do the following:
add this code to your plugin section:
/*
* Plugin: getQueryParam 2.3
*/
s.getQueryParam=new Function("p","d","u",""
+"var s=this,v='',i,t;d=d?d:'';u=u?u:(s.pageURL?s.pageURL:s.wd.locati"
+"on);if(u=='f')u=s.gtfs().location;while(p){i=p.indexOf(',');i=i<0?p"
+".length:i;t=s.p_gpv(p.substring(0,i),u+'');if(t){t=t.indexOf('#')>-"
+"1?t.substring(0,t.indexOf('#')):t;}if(t)v+=v?d+t:t;p=p.substring(i="
+"=p.length?i:i+1)}return v");
s.p_gpv=new Function("k","u",""
+"var s=this,v='',i=u.indexOf('?'),q;if(k&&i>-1){q=u.substring(i+1);v"
+"=s.pt(q,'&','p_gvf',k)}return v");
s.p_gvf=new Function("t","k",""
+"if(t){var s=this,i=t.indexOf('='),p=i<0?t:t.substring(0,i),v=i<0?'T"
+"rue':t.substring(i+1);if(p.toLowerCase()==k.toLowerCase())return s."
And in your doplugin area, I would just simply call the following:
s.campaign=s.getQueryParam('cid');
That way if the cid is present in the url, it will set s.campaign on the first hit and remember it throughout the visit (that's the standard out of the box setup).
The above is based on the assumption you are now on the appmeasurement code.
Good luck with it.
/Waqas
Views
Replies
Total Likes
Waqas, after implementing your suggestion, I'm seeing the events (Applications Started) show in the Tracking Code Report, but the credit is going to "None" instead of the tracking codes.
Arun, I have not thought about 'Clear Vars'. I will check my implementation and let you know.
Views
Replies
Total Likes
Do you mind opening the browser console, going to network tab, filter for "b/ss" and then put in the url with your domain and a random assigned cid, like the example here: YOURDOMAIN.COM?cid=adobeforumtest
You should see the variable V0 being set on the first request to the adobe analytics servers. Do you see the parameter parsed through to the adobe analytics call?
Views
Replies
Total Likes
Waqas Rafiq, under the Network tab, then under the Headers tab, yes, I am seeing v0: adobeforumtest.
Views
Replies
Total Likes
That means the code is working as it should. If you click start application and the event fires, that should be associated with that specific campaign now, without you having to set s.campaign again.
And that's not the case at the moment?
Views
Replies
Total Likes
This is not the case at the moment. After your suggestion of monitoring the network traffic, I think I know what's going on now.
Just a bit of history: We are phasing in the implementation to AppMeasurement (DTM) from Omniture s_code H.26. The products website is using the new AppMeasurement code while the start application event implementation is still using the H.26 code. AppMeasurement request url is going to 112.2o7.net while the start application event is going to smetrics.mydomain.com. So, while s.campaign (v0) is being sent to a different url than start application events, then the event will never give credit to s.campaign? Is this a correct assumption?
How can I get both implementations to go to the same reporting request url?
Views
Replies
Total Likes
Is the company going to continue using metrics.mydomain.com and smetrics.mydomain.com? If yes, then I would recommend to change your appmeasurement code to the following:
s_account = "reportsuiteid" //assuming these are the same across both codes
s.visitorNamespace = "" //should be the same for both codes
s.trackingServer = "metrics.yourdomain.com" //should be the same for both codes
s.trackingServerSecure = "smetrics.domain.com" //should be the same for both codes
If you have different values, you will have new visitors being registered and hence your s.campaign is not being set.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies