Offers APIs

The Offers APIs provides methods and events that can be used to capture additional visitors' attributes on the customer websites or can be used to integrate with third party analytics platforms to analyze the customer journey. A Javascript file is invoked from the Offers APIs. This file enables to capture offers events and post it to third party analytics platforms. E.g., whenever a visitor accepts an offer on the website, the event is captured and it is broadcasted to an interested third party analytics platform.

postOpenInvitationDivEx()

This method can be used to process any additional or custom functionality after the banner is floated on visitor's browser.

Parameters
  • bannerId: id of the banner
  • isAgentOffer: if the offer is agent offer
  • agentId: agent ID
  • divElem: div element associated with banner
Copy
Copied
eGOFR.postOpenInvitationDivEx = function(bannerid,isAgentOffer, agentId,divElem)
{
	console.log(bannerId);
}

preOnAcceptEx

Call this method to process any additional or custom functionality after Visitor accepts the offer and before the rule engine processes this Accept action.

Parameters
  • bannerId: id of the banner
  • ruleId: id of the rule applied
  • agentId: agent ID
Copy
Copied
eGOFR.preOnAcceptEx = function(bannerid, ruleid, agentId)
{
	console.log(bannerId);
}

postOnAcceptEx

Cakk this method to process any additional or custom functionality after rule engine processes Accept action (Visitor clicks on Accept/Ok/Yes button which is shown on Banner).

Parameters
  • bannerId: id of the banner
  • ruleId: id of the rule applied
  • agentId: agent ID
Copy
Copied
eGOFR.postOnAcceptEx = function(bannerid, ruleid, agentId)
{
	console.log(bannerId);
}

preOnRejectEx

Call this method to process any additional or custom functionality after Visitor rejects the offer and before the rule engine processes this Reject action.

Parameters
  • reason: reason associated with the event
  • bannerId: id of the banner
  • ruleId: id of the rule applied
Copy
Copied
eGOFR.preOnRejectEx = function(reason, bannerid, ruleid)
{
	console.log(bannerId);
}

preCloseInvitationDivEx

Call this method to process any additional or custom functionality after Visitor Rejects/Accepts/Ignores the offer and before rule engine hides the banner from Visitor's browser.

Parameters
  • reason: reason associated with the event
  • bannerId: id of the banner
  • ruleId: id of the rule applied
Copy
Copied
eGOFR.preCloseInvitationDivEx = function(reason, bannerid, ruleid)
{
	console.log(bannerId);
}

postCloseInvitationDivEx

Call this method to process any additional or custom functionality after rule engine hides the banner from Visitor's browser

Parameters
  • reason: reason associated with the event
  • bannerId: id of the banner
  • ruleId: id of the rule applied
Copy
Copied
eGOFR.postCloseInvitationDivEx = function(reason, bannerid, ruleid)
{
	console.log(bannerId);
}

PostLogEventEx

Call this method to process any additional or custom functionality after logging the event. E.g. Events or similar or related information can be logged or captured in external Database.

Parameters
  • stageId: stage ID
  • eventType: type of event(accept, reject, ignore, presented, client eligibility met, visitor converted )
  • sessionId: session ID associated with event
  • interactionId: interaction ID associated with event
  • offerId: id of the offer for which event took place
  • pageId: id of the page configured
  • eventAttribArr: array of event attributes
Copy
Copied
eGOFR.PostLogEventEx = function(stageId, eventType, sessionId, interactionId, offerId, pageId, eventAttribArr)
{
	console.log(bannerId);
}

PreCreateInteractionEx

A new interaction (an entry in EGPS_INTERACTION table) is created every time after condition is eligible and offer is eligible to show. Use this method to process any additional or custom functionality before creating an interaction.

Parameters
  • bannerId: id of the banner
  • offerType: type of offer(chat or phone)
  • ruleId: id of the rule applied
  • conditionsmet: conditions met(comma separated if more than one)
  • agentOffer: agent Offer(evaluated to 1 if visitor need to be added for chat else 0)
Copy
Copied
eGOFR.PreCreateInteractionEx = function(bannerId, offerType, ruleid, conditionsmet, agentOffer)
{
	console.log(bannerId);
}

PostCreateInteractionEx

A new interaction (an entry in EGPS_INTERACTION table) is created every time after condition is eligible and offer is eligible to show. Use this method to process any additional or custom functionality before creating an interaction.

Parameters
  • bannerId: id of the banner
  • offerType: type of offer(chat or phone)
  • ruleId: id of the rule applied
  • conditionsmet: conditions met(comma separated if more than one)
  • agentOffer: agent Offer(evaluated to 1 if visitor need to be added for chat else 0)
Copy
Copied
eGOFR.PostCreateInteractionEx = function(bannerId, offerType, ruleid, conditionsmet, agentOffer)
{
	console.log(bannerId);
}