Installation Instructions (Deprecated)
Install this generalized code just above the closing</body> tag of your website.
networkId and numberSelector to match your Invoca Network and current web page settings.
Note:You may find your
networkId pre-populated in sample code available in the Invoca platform:Requirements
- Network is PNAPI enabled.
- RingPools are type: “Custom”.
- Invoca Web Integration code installed on page.
- Phone numbers on webpage tagged with a shared numberSelector class (Accepts multiple slectors).
- An Invoca Campaign ID to associate with each number on the page (Or a Campaign ID Override).
Identifying a Campaign
There are three methods to identify an Invoca Campaign on your web page, which follow an order of precedence. 1. campaignIdOverrideParam: Specify a query string parameter’s name, the value of which will be used as the Invoca Campaign ID for all phone numbers in a given session. 2. destinationAsId: When true, the phone number’s digits (special characters stripped) from the numberSelector will be used as the Campaign ID. 3. data-invoca-campaign-id: When no override is passed, a user may assign individual Invoca Campaign IDs to a specific phone number’s HTML element using thedata-invoca-campaign-id attribute.
4. defaultCampaignId: With no override, a defaultCampaignId can be passed to the Invoca.PNAPI.integration settings and will fill in the gaps wherever no data-invoca-campaign-id is found. If there are no data attributes or overrides, this value will apply to all phone numbers on the page.
Additionally, the defaultCampaignId can be assigned dynamically with JavaScript based upon the page’s environment and variables.
Client Side Parameters
Note: Any parameter value can be populated with a JavaScript variable.Examples
campaignIdOverrideParam
To use a query string parameter as the Invoca Campaign ID for all phone numbers found on page, specify the parameter name in this option. To use the value of ?utm_source as the Campaign ID, follow this example: URL http://www.example-page.com?utm_source=google CODEdata-invoca-campaign-id’s and the defaultCampaignId being overriden.
data-invoca-campaign-id
To assign multiple numbers on a page to different Invoca Campaign IDs, simply add this attribute to each phone number element. URL http://www.example-page.com?utm_source=google CODEdefaultCampaignId
When no campaignIdOverride or data-invoca-campaign-id are found, the default campaign ID will be assigned to the call. CODEpoolParams
Allows variables from JavaScript to be associated with a call. CODErequiredParams
Conditionally runs Invoca’s web integration. URL #1 http://www.example-page.com?gclid=1a2b3c4d5e URL #2 http://www.example-page.com?ref=test CODEInvoca.PNAPI.run()
ReactMigrating from an older version
If you are migrating from SolutionsJS 1.2 or below, please refer to the following guide.1
Update your namespaces - Change
Solutions.PNAPI.integration to Invoca.PNAPI.integration - Change any Toolkit functions, like Solutions.PNAPI.readUrl to Invoca.Tools.readUrlMore on the Solutions Toolkit
2
Update your data attributes - Change
data-invoca to data-invoca-campaign-id3
Update your integration scripts from this:to just this: