Doubleclick Javascript Error



Hi All,

I've installed the doubleclick integration into my development site. The console is reporting an uncaught error saying that s.partnerDFACheck is not a function. Has anybody seen this before and knows what might be causing this?

Accepted Solutions (1)

Accepted Solutions (1)



This is linked to implementing the code via DTM.

I have since made progress on the code and I will explain it here for the benefit of anybody who needs it. The way the code is designed seems to be in the wrong order where it presents the DFA Variables, the Code itself and then the plugins required. To make it work properly, it needs to be restructured so that it goes DFA Variables, Plugins and THEN the code. This ensures the variables called in the code are available. Here's the code which has worked for me so far when placed in Library Management (below).



/************************** DFA VARIABLES **************************/
/* @TODO: Fill in these variables with the settings mapped in the 
 * DFA wizard and that match your desired preferences. Some of the 
 * variables are optional and have been labeled as such below. 
 * @TODO: Comments should be removed in a production deployment. */
var dfaConfig = {
    CSID:               '', // DFA Client Site ID
    SPOTID:             'XXXXXXXX', // DFA Spotlight ID
    tEvar:              'XXXXXX', // Transfer variable, typically the "View Through" eVar.
    errorEvar:          'XXXXX', // DFA error tracking (optional)
    timeoutEvent:       'XXXXXX', // Tracks timeouts/empty responses (optional)
    requestURL:         "XXXXXX", // the DFA request URL
    maxDelay:           "XXXXXX", // The maximum time to wait for DFA servers to respond, in milliseconds.
    visitCookie:        "XXXXXX", // The name of the visitor cookie to use to restrict DFA calls to once per visit.
    clickThroughParam:  "XXXXXX", // A query string paramter that will force the DFA call to occur.
    searchCenterParam: XXXXXX, // SearchCenter identifier.
    newRsidsProp:       XXXXXX // Stores the new report suites that need the DFA tracking code. (optional)
/************************ END DFA Variables ************************/

 * Partner Plugin: DFA Check 1.0 - Restrict DFA calls to once a visit, per report suite, per click 
 * through. Used in conjunction with VISTA. Deduplicates SCM hits.
s.partnerDFACheck=new Function("cfg","" 
+"var s=this,c=cfg.visitCookie,src=cfg.clickThroughParam,scp=cfg.searchCenterParam,p=cfg.newRsidsProp,tv=cfg.tEvar,dl=',',cr,nc,q,g,gs,i,j,k,fnd,v=1,t=new Date,cn=0,ca=new Array,aa=new Array,cs=new A"
+"rray;t.setTime(t.getTime()+1800000);cr=s.c_r(c);if(cr){v=0;}ca=s.split(cr,dl);if(s.un)aa=s.split(s.un,dl);else aa=s.split(s.account,dl);for(i=0;i<aa.length;i++){fnd = 0;for(j=0;j<ca.length;j++){if(aa[i] == ca[j]){fnd=1;}}if(!fnd){cs[cn"
+"erCase()+'=');gs=(scp)?q.indexOf('&'+scp.toLowerCase()+'='):-1;if(g>-1){s.vpr(p,cr);v=1;}else if(gs>-1){v=0;s.vpr(tv,'SearchCenter Visitors');}if(!s.c_w(c,cr,t)){s.c_w(c,cr,0);}if(!s.c_r(c)){v=0;}r"
+"eturn v>=1;"); 

 * Supporting functions that may be shared between plug-ins

 * Utility Function: vpr - set the variable vs with value v
s.vpr=new Function("vs","v",
"if(typeof(v)!='undefined' && vs){var s=this; eval('s.'+vs+'=\"'+v+'\"')}");

 * Utility Function: split v1.5 - split a string (JS 1.0 compatible)
s.split=new Function("l","d",""
+"var i,x=0,a=new Array;while(l){i=l.indexOf(d);i=i>-1?i:l.length;a[x++]=l.substring(0,i);l=l.substring(i+d.length);}return a");

 * Plugin Utility: Replace v1.0
s.repl=new Function("x","o","n",""
+"var i=x.indexOf(o),l=n.length;while(x&&i>=0){x=x.substring(0,i)+n+x.substring(i+o.length);i=x.indexOf(o,i+l)}return x");

/************************** DFA CODE START **************************/
s.maxDelay = dfaConfig.maxDelay;
s.Integrate.onLoad=function(s,m) {
    var dfaCheck = s.partnerDFACheck(dfaConfig);
    if (dfaCheck) {
        s.Integrate.DFA.setVars=function(s,p) {
            if (window[p.VAR]) { // got a response
                if(! { // no errors
                } else if (p.errorEvar) { // got an error response, track
                    s[p.errorEvar] =;
            } else if (p.timeoutEvent) { // empty response or timeout
       = ((! || == '') ? '' : ( + ',')) + p.timeoutEvent; // timeout event

/************************** DFA CODE END **************************/

Answers (6)

Answers (6)




We're experiencing the same error when implementing DFA with Launch (TypeError: e.partnerDFACheck is not a function).

Is there any solution to this in the meantime (changing the order of the code as proposed above did not make the trick for us)

Thanks, Marco


Community Manager


Hi Michael,

Thank you for providing your code. Does this mean you were able to work out the issue on your own? If so, I'd like to mark your answer as correct for those who might also have this question in the future. 





Hi Michael ,

Is the query linked to implementation of Double Click Tags i.e. Third Party Tag  via DTM or you are deploying the double click code by some other method ?

Thanks & Regards

Parit Mittal