Skip to content

Instantly share code, notes, and snippets.

@sbounmy
Last active October 13, 2020 10:13
Show Gist options
  • Save sbounmy/e47b7e2ac3287ee6a4f0a73dcfa26528 to your computer and use it in GitHub Desktop.
Save sbounmy/e47b7e2ac3287ee6a4f0a73dcfa26528 to your computer and use it in GitHub Desktop.
import wixLocation from 'wix-location';
import wixWindow from 'wix-window';
import { getCustomer } from 'backend/stripe';
$w.onReady(async function () {
(function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){
(t[a].q=t[a].q||[]).push(arguments)}})(wixWindow,'tap');
var sessionId = wixLocation.query.session_id;
var customer = await getCustomer(sessionId);
// is defined but does not trigger on test integration tester...
wixWindow.tap('create', 'my-id', { integration: "stripe" });
wixWindow.tap('trial', customer);
// wixWindow.tap('trial', 'test1234');
});
@sbounmy
Copy link
Author

sbounmy commented Oct 13, 2020

The other code is included in <head> as follow

  <script type="text/javascript">
      (function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){
      (t[a].q=t[a].q||[]).push(arguments)}})(window,'tap');

      tap('create', 'm y-id', { integration: "stripe" });
      tap('detect');
  </script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment