Self-hosting the Invoca Tag library eliminates two of the three HTTP requests a page normally makes for Invoca, useful for accounts with strict third-party script policies or performance requirements.For accounts with a security policy that restricts third-party or vendor scripts, or for accounts that prioritize minimizing HTTP requests on their pages, self-hosting the Invoca Tag can be a good solution. Self-hosting eliminates two of the three HTTP requests typically made during a page load with the Invoca Tag.
Step 1: Obtain the latest version of the Invoca JavaScript Library
- In your browser, go to
http://solutions.invocacdn.com/js/invoca-latest.min.js. The page loads the latest version of the JS library. - Copy or save the page locally.
- Upload the library file to wherever you’ll be hosting it, and note the path to the file if you’ll be using the static tag snippet.
Step 2: Deploy the library and Invoca Tag JS
Call the library to the page via the header from wherever you’re hosting it. Next, get the Invoca Tag JS — the code that handles all number swapping and attribution settings. You have two options:- Static snippet: Keeps you on the Invoca Platform UI for iterating versions, testing, and change history.
- Raw JS: Ensures all JS is hosted by you, but requires a redeploy any time you want to update the tag or attribution logic.