Skip to main content
Tweeted twitter.com/#!/StackSalesforce/status/633400266109362176
I have changed the question following the advice given by a user..
Source Link
Andrea Ianni
  • 1.2k
  • 1
  • 12
  • 23

URL-hacking: issue on the LiveAgent.startChat(): wrong redirecting

<apex:page docType="html-5.0" showHeader="false"  cache="true" > 

<head> Redirecting to the Liveagent chat Page </head>

<div id="liveagent_invite_button_5732500000XXXXX" style='margin:0px; padding: 0px; width:400px; border-radius:8px; display: none;' >
<!-- DEPLOYMENT -->

<script type='text/javascript' src='https://c.la1-c1cs-lon.salesforceliveagent.com/content/g/js/34.0/deployment.js'></script>
<script>

    //-------------------------------------------------------
    // In this part I insert informations that I will need when I will 
    // open the chat with the Agent.
    //-------------------------------------------------------
    liveagent.addCustomDetail("IdAOL", new Date().getTime());
    liveagent.findOrCreate("Info__c").map("ID_AOL__c", "IdAOL", false, false,true);
    liveagent.findOrCreate("Info__c").showOnCreate();
    liveagent.findOrCreate("Info__c").saveToTranscript("Info__c","Info__c");
    liveagent.findOrCreate("Survey_Operatore__c").map("ID_AOL__c", "IdAOL", false, false,true);
    liveagent.findOrCreate("Survey_Operatore__c").showOnCreate();
    liveagent.findOrCreate("Survey_Operatore__c").saveToTranscript("Survey_Operatore__c","Survey_Operatore__c");
    liveagent.init('https://d.la1-c1cs-lon.salesforceliveagent.com/chat', '5722500000XXXXX', '00D25000000XXXX');
    //----------------------------------------------
    // start of the chat that doesgiving notus workthe hereproblem!!!
    // liveagent.startChat('5732500000XXXXX', true); 

</script>

// Instead of the StartChatURL-hacking I have used this URL toam openNOT theusing chatanymore
// <body onload="window.location.href = 'https://1c3.la1-c1cs-lon.salesforceliveagent.com/content/s/chat?language=it#deployment_id=57225000000XXXX&org_id=00D25000000XXXX&button_id=5732500000XXXXX';">
</body>

<!-- FINE DEPLOYMENT -->
</div>
  
</apex:page>

My problem is: when the chat opensXXX nb= I don't have all the information that I had using the StartChat method (obtained by addCustomDetails, findOrCreate, etc etc)want solve through URL-hacking. XXX

Possible solution 1: is it possibleThe page redirects to put those informations intoa PreChat that is NOT on the URL?

Ifinvitation. I do use StartChat instead of URL-Hackingthink it could be a Salesforce issue, but I have this problem whencannot find it on the chat pops-up:web. enter image description here

URL-hacking: issue on the LiveAgent

<apex:page docType="html-5.0" showHeader="false"  cache="true" > 

<head> Redirecting to the Liveagent chat Page </head>

<div id="liveagent_invite_button_5732500000XXXXX" style='margin:0px; padding: 0px; width:400px; border-radius:8px; display: none;' >
<!-- DEPLOYMENT -->

<script type='text/javascript' src='https://c.la1-c1cs-lon.salesforceliveagent.com/content/g/js/34.0/deployment.js'></script>
<script>

    //-------------------------------------------------------
    // In this part I insert informations that I will need when I will 
    // open the chat with the Agent.
    //-------------------------------------------------------
    liveagent.addCustomDetail("IdAOL", new Date().getTime());
    liveagent.findOrCreate("Info__c").map("ID_AOL__c", "IdAOL", false, false,true);
    liveagent.findOrCreate("Info__c").showOnCreate();
    liveagent.findOrCreate("Info__c").saveToTranscript("Info__c","Info__c");
    liveagent.findOrCreate("Survey_Operatore__c").map("ID_AOL__c", "IdAOL", false, false,true);
    liveagent.findOrCreate("Survey_Operatore__c").showOnCreate();
    liveagent.findOrCreate("Survey_Operatore__c").saveToTranscript("Survey_Operatore__c","Survey_Operatore__c");
    liveagent.init('https://d.la1-c1cs-lon.salesforceliveagent.com/chat', '5722500000XXXXX', '00D25000000XXXX');
    //----------------------------------------------
    // start of the chat that does not work here!!!
    // liveagent.startChat('5732500000XXXXX', true); 

</script>

// Instead of the StartChat I have used this URL to open the chat
<body onload="window.location.href = 'https://1c3.la1-c1cs-lon.salesforceliveagent.com/content/s/chat?language=it#deployment_id=57225000000XXXX&org_id=00D25000000XXXX&button_id=5732500000XXXXX';">
</body>

<!-- FINE DEPLOYMENT -->
</div>
  
</apex:page>

My problem is: when the chat opens I don't have all the information that I had using the StartChat method (obtained by addCustomDetails, findOrCreate, etc etc).

Possible solution 1: is it possible to put those informations into the URL?

If I do use StartChat instead of URL-Hacking I have this problem when the chat pops-up: enter image description here

LiveAgent.startChat(): wrong redirecting

<apex:page docType="html-5.0" showHeader="false"  cache="true" > 

<head> Redirecting to the Liveagent chat Page </head>

<div id="liveagent_invite_button_5732500000XXXXX" style='margin:0px; padding: 0px; width:400px; border-radius:8px; display: none;' >
<!-- DEPLOYMENT -->

<script type='text/javascript' src='https://c.la1-c1cs-lon.salesforceliveagent.com/content/g/js/34.0/deployment.js'></script>
<script>

    //-------------------------------------------------------
    // In this part I insert informations that I will need when I will 
    // open the chat with the Agent.
    //-------------------------------------------------------
    liveagent.addCustomDetail("IdAOL", new Date().getTime());
    liveagent.findOrCreate("Info__c").map("ID_AOL__c", "IdAOL", false, false,true);
    liveagent.findOrCreate("Info__c").showOnCreate();
    liveagent.findOrCreate("Info__c").saveToTranscript("Info__c","Info__c");
    liveagent.findOrCreate("Survey_Operatore__c").map("ID_AOL__c", "IdAOL", false, false,true);
    liveagent.findOrCreate("Survey_Operatore__c").showOnCreate();
    liveagent.findOrCreate("Survey_Operatore__c").saveToTranscript("Survey_Operatore__c","Survey_Operatore__c");
    liveagent.init('https://d.la1-c1cs-lon.salesforceliveagent.com/chat', '5722500000XXXXX', '00D25000000XXXX');
    //----------------------------------------------
    // start of the chat giving us the problem!!!
    liveagent.startChat('5732500000XXXXX', true); 

</script>

// URL-hacking I am NOT using anymore
// <body onload="window.location.href = 'https://1c3.la1-c1cs-lon.salesforceliveagent.com/content/s/chat?language=it#deployment_id=57225000000XXXX&org_id=00D25000000XXXX&button_id=5732500000XXXXX';">
</body>

<!-- FINE DEPLOYMENT -->
</div>
  
</apex:page>

XXX nb= I don't want solve through URL-hacking. XXX

The page redirects to a PreChat that is NOT on the invitation. I think it could be a Salesforce issue, but I cannot find it on the web. enter image description here

added 179 characters in body
Source Link
Andrea Ianni
  • 1.2k
  • 1
  • 12
  • 23
<apex:page docType="html-5.0" showHeader="false"  cache="true" > 

<head> Redirecting to the Liveagent chat Page </head>

<div id="liveagent_invite_button_5732500000XXXXX" style='margin:0px; padding: 0px; width:400px; border-radius:8px; display: none;' >
<!-- DEPLOYMENT -->

<script type='text/javascript' src='https://c.la1-c1cs-lon.salesforceliveagent.com/content/g/js/34.0/deployment.js'></script>
<script>

    //-------------------------------------------------------
    // In this part I insert informations that I will need when I will 
    // open the chat with the Agent.
    //-------------------------------------------------------
    liveagent.addCustomDetail("IdAOL", new Date().getTime());
    liveagent.findOrCreate("Info__c").map("ID_AOL__c", "IdAOL", false, false,true);
    liveagent.findOrCreate("Info__c").showOnCreate();
    liveagent.findOrCreate("Info__c").saveToTranscript("Info__c","Info__c");
    liveagent.findOrCreate("Survey_Operatore__c").map("ID_AOL__c", "IdAOL", false, false,true);
    liveagent.findOrCreate("Survey_Operatore__c").showOnCreate();
    liveagent.findOrCreate("Survey_Operatore__c").saveToTranscript("Survey_Operatore__c","Survey_Operatore__c");
    liveagent.init('https://d.la1-c1cs-lon.salesforceliveagent.com/chat', '5722500000XXXXX', '00D25000000XXXX');
    //----------------------------------------------
    // start of the chat that does not work here!!!
    // liveagent.startChat('5732500000XXXXX', true); 

</script>

// Instead of the StartChat I have used this URL to open the chat
<body onload="window.location.href = 'https://1c3.la1-c1cs-lon.salesforceliveagent.com/content/s/chat?language=it#deployment_id=57225000000XXXX&org_id=00D25000000XXXX&button_id=5732500000XXXXX';">
</body>

<!-- FINE DEPLOYMENT -->
</div>
  
</apex:page>

My problem is: when the chat opens I don't have all the information that I had using the StartChat method (obtained by addCustomDetails, findOrCreate, etc etc).

Possible solution 1: is it possible to put those informations into the URL?

If I do use StartChat instead of URL-Hacking I have this problem when the chat pops-up: enter image description here

<apex:page docType="html-5.0" showHeader="false"  cache="true" > 

<head> Redirecting to the Liveagent chat Page </head>

<div id="liveagent_invite_button_5732500000XXXXX" style='margin:0px; padding: 0px; width:400px; border-radius:8px; display: none;' >
<!-- DEPLOYMENT -->

<script type='text/javascript' src='https://c.la1-c1cs-lon.salesforceliveagent.com/content/g/js/34.0/deployment.js'></script>
<script>

    //-------------------------------------------------------
    // In this part I insert informations that I will need when I will 
    // open the chat with the Agent.
    //-------------------------------------------------------
    liveagent.addCustomDetail("IdAOL", new Date().getTime());
    liveagent.findOrCreate("Info__c").map("ID_AOL__c", "IdAOL", false, false,true);
    liveagent.findOrCreate("Info__c").showOnCreate();
    liveagent.findOrCreate("Info__c").saveToTranscript("Info__c","Info__c");
    liveagent.findOrCreate("Survey_Operatore__c").map("ID_AOL__c", "IdAOL", false, false,true);
    liveagent.findOrCreate("Survey_Operatore__c").showOnCreate();
    liveagent.findOrCreate("Survey_Operatore__c").saveToTranscript("Survey_Operatore__c","Survey_Operatore__c");
    liveagent.init('https://d.la1-c1cs-lon.salesforceliveagent.com/chat', '5722500000XXXXX', '00D25000000XXXX');
    //----------------------------------------------
    // start of the chat that does not work here!!!
    // liveagent.startChat('5732500000XXXXX', true); 

</script>

// Instead of the StartChat I have used this URL to open the chat
<body onload="window.location.href = 'https://1c3.la1-c1cs-lon.salesforceliveagent.com/content/s/chat?language=it#deployment_id=57225000000XXXX&org_id=00D25000000XXXX&button_id=5732500000XXXXX';">
</body>

<!-- FINE DEPLOYMENT -->
</div>
  
</apex:page>

My problem is: when the chat opens I don't have all the information that I had using the StartChat method (obtained by addCustomDetails, findOrCreate, etc etc).

Possible solution: is it possible to put those informations into the URL?

<apex:page docType="html-5.0" showHeader="false"  cache="true" > 

<head> Redirecting to the Liveagent chat Page </head>

<div id="liveagent_invite_button_5732500000XXXXX" style='margin:0px; padding: 0px; width:400px; border-radius:8px; display: none;' >
<!-- DEPLOYMENT -->

<script type='text/javascript' src='https://c.la1-c1cs-lon.salesforceliveagent.com/content/g/js/34.0/deployment.js'></script>
<script>

    //-------------------------------------------------------
    // In this part I insert informations that I will need when I will 
    // open the chat with the Agent.
    //-------------------------------------------------------
    liveagent.addCustomDetail("IdAOL", new Date().getTime());
    liveagent.findOrCreate("Info__c").map("ID_AOL__c", "IdAOL", false, false,true);
    liveagent.findOrCreate("Info__c").showOnCreate();
    liveagent.findOrCreate("Info__c").saveToTranscript("Info__c","Info__c");
    liveagent.findOrCreate("Survey_Operatore__c").map("ID_AOL__c", "IdAOL", false, false,true);
    liveagent.findOrCreate("Survey_Operatore__c").showOnCreate();
    liveagent.findOrCreate("Survey_Operatore__c").saveToTranscript("Survey_Operatore__c","Survey_Operatore__c");
    liveagent.init('https://d.la1-c1cs-lon.salesforceliveagent.com/chat', '5722500000XXXXX', '00D25000000XXXX');
    //----------------------------------------------
    // start of the chat that does not work here!!!
    // liveagent.startChat('5732500000XXXXX', true); 

</script>

// Instead of the StartChat I have used this URL to open the chat
<body onload="window.location.href = 'https://1c3.la1-c1cs-lon.salesforceliveagent.com/content/s/chat?language=it#deployment_id=57225000000XXXX&org_id=00D25000000XXXX&button_id=5732500000XXXXX';">
</body>

<!-- FINE DEPLOYMENT -->
</div>
  
</apex:page>

My problem is: when the chat opens I don't have all the information that I had using the StartChat method (obtained by addCustomDetails, findOrCreate, etc etc).

Possible solution 1: is it possible to put those informations into the URL?

If I do use StartChat instead of URL-Hacking I have this problem when the chat pops-up: enter image description here

Source Link
Andrea Ianni
  • 1.2k
  • 1
  • 12
  • 23

URL-hacking: issue on the LiveAgent

<apex:page docType="html-5.0" showHeader="false"  cache="true" > 

<head> Redirecting to the Liveagent chat Page </head>

<div id="liveagent_invite_button_5732500000XXXXX" style='margin:0px; padding: 0px; width:400px; border-radius:8px; display: none;' >
<!-- DEPLOYMENT -->

<script type='text/javascript' src='https://c.la1-c1cs-lon.salesforceliveagent.com/content/g/js/34.0/deployment.js'></script>
<script>

    //-------------------------------------------------------
    // In this part I insert informations that I will need when I will 
    // open the chat with the Agent.
    //-------------------------------------------------------
    liveagent.addCustomDetail("IdAOL", new Date().getTime());
    liveagent.findOrCreate("Info__c").map("ID_AOL__c", "IdAOL", false, false,true);
    liveagent.findOrCreate("Info__c").showOnCreate();
    liveagent.findOrCreate("Info__c").saveToTranscript("Info__c","Info__c");
    liveagent.findOrCreate("Survey_Operatore__c").map("ID_AOL__c", "IdAOL", false, false,true);
    liveagent.findOrCreate("Survey_Operatore__c").showOnCreate();
    liveagent.findOrCreate("Survey_Operatore__c").saveToTranscript("Survey_Operatore__c","Survey_Operatore__c");
    liveagent.init('https://d.la1-c1cs-lon.salesforceliveagent.com/chat', '5722500000XXXXX', '00D25000000XXXX');
    //----------------------------------------------
    // start of the chat that does not work here!!!
    // liveagent.startChat('5732500000XXXXX', true); 

</script>

// Instead of the StartChat I have used this URL to open the chat
<body onload="window.location.href = 'https://1c3.la1-c1cs-lon.salesforceliveagent.com/content/s/chat?language=it#deployment_id=57225000000XXXX&org_id=00D25000000XXXX&button_id=5732500000XXXXX';">
</body>

<!-- FINE DEPLOYMENT -->
</div>
  
</apex:page>

My problem is: when the chat opens I don't have all the information that I had using the StartChat method (obtained by addCustomDetails, findOrCreate, etc etc).

Possible solution: is it possible to put those informations into the URL?