Cycling Frog is a CBD and THC Seltzer brand headquartered in Seattle.
With their wide distribution, they utilize Vermont Information Processing (VIP). VIP is the leading finder API for people in the beverage industry.
But Cycling Frog ran into a problem. A lot of their wholesale beverages were being sold through Shopify, but were not being integrated into the API and thus their finder app.
Built on Shopify, they asked us to create a custom API feed that would take VIP data, Shopify Data, and even allow custom retail accounts.
Leveraging WordPress as the Engine
We rooted the API URL in the WordPress content management system.
In it, we set up cURLs to the VIP API that run hourly to synchronize data.
We then, built a Shopify integration into it that would pull wholesaler buyers according to customer data. The data needed to be parsed by specific parameters, including the customer’s last buy.
This data also updates hourly and drops off accounts that are not within the date range.
Finally, we created a custom location adder matching the field structure that would allow Cycling Frog to add wholesalers outside Shopify and VIP.
Within WordPress, we built functions to sort all of the data. Our biggest challenge was to make sure all the various sources were mapped to central field conventions.
Although these sources are vastly different, we almagamated them into a singular stream of data.
A Map for Finding Your Frog
The final result is built on Shopify.
Upon search, it queries the custom API and locates the product at applicable locations.
The API feed is encrypted to prevent misuse outside of the Shopify use-case.
New project? Question? Compliment? Let’s chat. New project? Question? Compliment? Let’s chat.
{"head":"<!-- Google Tag Manager -->\r\n<script>\r\n (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\r\n new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\r\n j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\r\n 'https:\/\/www.googletagmanager.com\/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\r\n })(window,document,'script','dataLayer','GTM-WMDNFKPG');\r\n<\/script>\r\n<!-- End Google Tag Manager -->","body":"<!-- Google Tag Manager (noscript) -->\r\n<noscript><iframe src=\u201chttps:\/\/www.googletagmanager.com\/ns.html?id=GTM-WMDNFKPG\u201d\r\nheight=\u201c0\" width=\u201c0\u201d style=\u201cdisplay:none;visibility:hidden\u201d><\/iframe><\/noscript>\r\n<!-- End Google Tag Manager (noscript) -->","footer":"<script>\r\n(function(){\r\n\r\n var JOURNEY_KEY = 'th_lead_journey_v1';\r\n var MAX_PAGES = 20;\r\n\r\n function uuid(){\r\n if (crypto.randomUUID) {\r\n return crypto.randomUUID();\r\n }\r\n\r\n return 'th_' + Date.now() + '_' + Math.random().toString(36).substr(2);\r\n }\r\n\r\n function getJourney(){\r\n try{\r\n return JSON.parse(localStorage.getItem(JOURNEY_KEY));\r\n }catch(e){\r\n return null;\r\n }\r\n }\r\n\r\n function saveJourney(journey){\r\n localStorage.setItem(JOURNEY_KEY, JSON.stringify(journey));\r\n }\r\n\r\n function getUTMs(){\r\n var params = new URLSearchParams(location.search);\r\n var utm = {};\r\n\r\n [\r\n 'utm_source',\r\n 'utm_medium',\r\n 'utm_campaign',\r\n 'utm_term',\r\n 'utm_content',\r\n 'gclid',\r\n 'gbraid',\r\n 'wbraid',\r\n 'fbclid'\r\n ].forEach(function(key){\r\n if(params.has(key)){\r\n utm[key] = params.get(key);\r\n }\r\n });\r\n\r\n return utm;\r\n }\r\n\r\n var journey = getJourney();\r\n\r\n if(!journey){\r\n\r\n journey = {\r\n session_id: uuid(),\r\n started: new Date().toISOString(),\r\n landing_page: location.href,\r\n landing_path: location.pathname,\r\n referrer: document.referrer,\r\n utm: getUTMs(),\r\n pages: []\r\n };\r\n\r\n }\r\n\r\n var last = journey.pages[journey.pages.length - 1];\r\n\r\n if(!last || last.url !== location.href){\r\n\r\n journey.pages.push({\r\n url: location.href,\r\n path: location.pathname,\r\n title: document.title,\r\n timestamp: new Date().toISOString()\r\n });\r\n\r\n if(journey.pages.length > MAX_PAGES){\r\n journey.pages.shift();\r\n }\r\n\r\n }\r\n\r\n saveJourney(journey);\r\n\r\n function populate(){\r\n\r\n document.querySelectorAll('form').forEach(function(form){\r\n\r\n set(form,'lead_session_id',journey.session_id);\r\n set(form,'lead_landing_page',journey.landing_page);\r\n set(form,'lead_journey_json',JSON.stringify(journey));\r\n set(form,'lead_journey',buildSummary());\r\n\r\n });\r\n\r\n }\r\n\r\n function set(form,name,value){\r\n\r\n var field = form.querySelector('[name=\"'+name+'\"]');\r\n\r\n if(!field){\r\n field = document.createElement('input');\r\n field.type = 'hidden';\r\n field.name = name;\r\n form.appendChild(field);\r\n }\r\n\r\n field.value = value;\r\n }\r\n\r\n function buildSummary(){\r\n\r\n var out = [];\r\n\r\n out.push('Landing: ' + journey.landing_page);\r\n out.push('');\r\n\r\n journey.pages.forEach(function(page,i){\r\n out.push((i+1) + '. ' + page.path);\r\n });\r\n\r\n return out.join(\"n\");\r\n\r\n }\r\n\r\n populate();\r\n\r\n document.addEventListener('wpcf7beforesubmit', populate);\r\n\r\n})();\r\n<\/script>"}
We use cookies
We use necessary cookies to make this site work. With your consent, we also use analytics and advertising technologies to improve the site and measure marketing.