GithubHelp home page GithubHelp logo

capi-param-builder's Introduction

Conversions API parameter builder: SDK to help improve Conversions API param quality

Introduction

Conversions API parameter builder SDK is a lightweight tool for improving Conversions API parameter retrieval and quality. The SDK helps ensure event parameters adhere to best practices.

Parameter builder supports 5 server-side languages and 1 clientside language:

  • Server-side: PHP, Java, NodeJS, Python and Ruby.
  • Client-side: JavaScript.

Check Parameter Builder Library Overview for more details. In each languages' subfolder, we provide quick start guide and examples.


License

Conversions API parameter builder SDKs are licensed under the LICENSE file in the root directory of this source tree.

capi-param-builder's People

Contributors

hongj-src avatar ppwang-sa avatar dependabot[bot] avatar meta-codesync[bot] avatar bowiechen avatar facebook-github-bot avatar witzenx avatar

Stargazers

 avatar Seth Allen avatar ReGen DevOps avatar Paulo Joseppe avatar Joaquín Pérez avatar  avatar Sebastián Jiménez T avatar  avatar  avatar Lekhnath Rijal avatar  avatar NetCrazy avatar Dr Chad OKAY avatar Periklis Papanikolaou avatar  avatar Gilles avatar Martins Muiznieks avatar Amal Jose Alex avatar  avatar Anish avatar

Watchers

 avatar Andrew J Brush avatar

capi-param-builder's Issues

explanation of the appendix value

Hi there,

Could you please provide a explanation of what the appendix value of the generated _fbc value is good for?
The official docs only list 4 parts of the fbc value - you generate 5 with the js client library.

For privacy reasons, it is important to understand:

  • How you generate it (input parameters and algroithm)
  • What it is used for in further processing

Cheers

Questions Regarding the Client Side Scripts

Hey there!

  1. Is there a reason why client_js isn't available as a package on NPM like the nodejs version is? Having it as a package we can bundle ourselves would make it much easier to use.
  2. If you can't do the above - is the nodejs package actually dependent on any node specifics? Meaning - could it not run in any JS runtime (node, browsers, Deno, Bun etc.)?
  3. It'd be great if you could ship TS type definitions with the NPM package(s)!

Client JS Param Builder SDK causing conflicts in Magento 2 Checkout websites

Issue

Everything is already detailed here facebook/GoogleTagManager-WebTemplate-For-FacebookPixel#31. I'm just bringing this issue to the correct repo.

Fix

After playing around with the source code, I've found a simple fix to stop the conflicts.

The fix is simply to add umdNamedDefine: true direct to the output options in webpack.config.js.

// ...
output: {
  path: path.resolve(__dirname, `dist`),
  filename: `[name].bundle.js`,
  library: `[name]`,
  libraryTarget: `umd`,
  umdNamedDefine: true // <--- FIX!
}
// ...

Altough the conflict ceases, the clientParamBuilder object is still not defined in window in Magento 2 Checkout. This would require adding some sort of plugin or script to modify the clientParamBuilder.bundle.js file after build, which I won't cover here.

After building, the bundle first lines of code are changed from define([], t) to define('clientParamBuilder', [], t).

!(function (r, t) {
  'object' == typeof exports && 'object' == typeof module
    ? (module.exports = t())
    : 'function' == typeof define && define.amd
      ? define('clientParamBuilder', [], t)                                    /* <--- FIX! */
      : 'object' == typeof exports
        ? (exports.clientParamBuilder = t())
        : (r.clientParamBuilder = t());
})(self, () => ...

This effectively avoids the conflict when the Param Builder SDK loads after the Magento RequireJS (require.min.js) in Magento 2 Checkout.

Where is the source code for clientParamBuilder.bundle.js?

Hi team,

I’m trying to review the client-side library referenced in the documentation:

<script src="https://capi-automation.s3.us-east-2.amazonaws.com/public/client_js/capiParamBuilder/clientParamBuilder.bundle.js"></script>

However, I cannot find the corresponding readable src/ folder or source files for this bundle in the GitHub repository.
Currently, the repo shows the compiled/minified bundle, but not the original source code.

Questions:

Is the full source code for clientParamBuilder.bundle.js open-source and available somewhere?

If yes, where can we find the readable (non-minified) implementation?

If no, is it possible to publish the source so that developers can audit it (for security, privacy, and GDPR compliance), since this script handles cookies and identifiers (fbc, fbp, IP, etc.)?

This would be helpful for teams who need to perform compliance checks before deploying this on production, especially in regulated industries.

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.