Pular para o conteúdo principal

plugins

Purpose and Production Relevance

plugins contains customer-platform plugin experiments/integrations, mainly WordPress and Shopify-oriented code. These plugins appear intended to help customers inject Crimoo/GTM scripts and send ecommerce or identity data into Crimoo.

Production relevance: supporting integrations. Confirm active plugin packaging and deployment process before treating any plugin as production-ready.

Stack and Main Dependencies

  • PHP plugin code.
  • WordPress plugin structure.
  • Shopify-oriented PHP/Liquid structure.
  • Small JavaScript snippets for admin/dataLayer behavior.

Important files and folders:

  • plugins/wordpress-plugin/crimoo-gtm
  • plugins/wordpress-plugin/crimoo-auth
  • plugins/shopify-plugin/crimoo-shopify-gtm

Business Responsibilities

The plugin area exists to reduce customer setup work:

  • Inject Crimoo/GTM scripts into a customer CMS/storefront.
  • Provide admin settings for connecting to Crimoo.
  • Push ecommerce or identity data into the page/dataLayer.
  • Potentially send webhooks such as order-paid events.

Technical Architecture and Source-Code Entry Points

WordPress plugin pattern:

  • Main plugin PHP file registers hooks.
  • admin folder provides settings UI.
  • includes folder contains API/dataLayer/script-injection classes.
  • assets or public folders contain browser/admin JavaScript.

Shopify plugin pattern:

  • Main PHP app/plugin file.
  • Liquid snippet for storefront injection.
  • Webhook handlers for commerce events.

Key Data Flows and Service Integrations

Expected flows:

  • Admin configures Crimoo/GTM IDs.
  • Plugin injects loader or GTM script into storefront pages.
  • Storefront pushes ecommerce/customer events to dataLayer.
  • Crimoo tracking path receives those events through gtm-proxy.
  • Optional webhook handlers send server-side commerce events to Crimoo APIs.

Environment, Deploy, and Runtime Notes

No unified package/build script was found at the plugins root.

Validation is likely manual:

  • Install plugin in a local WordPress site.
  • Configure plugin settings.
  • Inspect generated page HTML.
  • Confirm tracking requests reach the Crimoo domain.

Debugging Checklist

  • If script injection fails, check CMS hook registration and theme placement.
  • If settings do not save, check nonce/capability handling and options storage.
  • If ecommerce events are missing, check dataLayer payload shape and event timing.
  • If requests do not reach Crimoo, check configured domain, protocol, and blocked script paths.
  • If webhook handlers fail, check signatures/secrets and endpoint URL.

Tests or Validation Commands

No automated test commands are currently known.

Manual validation:

  • Install in a local CMS/store test environment.
  • Enable plugin and inspect rendered HTML.
  • Trigger checkout/order events in a sandbox.
  • Confirm browser requests in devtools and Crimoo analytics/debug views.

Mastery Checklist

  • Explain how each plugin injects scripts.
  • Know which events the plugin emits or forwards.
  • Validate plugin behavior in a real CMS/store sandbox before changing production docs.
  • Keep plugin assumptions separate from the core gtm-proxy/gtm-fabric runtime.