Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PayPal Insights Integration #904

Closed
angelleye opened this issue Oct 14, 2017 · 41 comments
Closed

PayPal Insights Integration #904

angelleye opened this issue Oct 14, 2017 · 41 comments

Comments

@angelleye
Copy link
Collaborator

We talked about doing this as a stand-alone WP plugin, but PayPal has asked us to simply include it in this plugin for now.

@angelleye
Copy link
Collaborator Author

@kcppdevelopers I'd like to add PayPal Insights as a new tab under Settings -> PayPal for WooCommerce -> General. We can drop in the JS for the activate/modify button into this settings panel, and then we'll drop the regular JS for page content so that the PayPal banner displays based on the Insights configuration.

@angelleye
Copy link
Collaborator Author

@kcppdevelopers I'm a little bit confused here.

In our settings panel I see a check box to enable Insights, but I don't see the actual Activate / Modify button showing up anywhere..??

Also, I'm not sure why we have to fill out a "Merchant's website URL" field..?? I don't remember seeing the need for that in the Insights docs, and even if we do need it, couldn't we just use the WP site URL?

@angelleye
Copy link
Collaborator Author

angelleye commented Oct 16, 2017

@kcppdevelopers Here's a sample PayPal Insights (MUSE) plugin for Woo that PayPal put together:

GitHub: https://github.com/trainerbill/woocommerce-paypal-marketing
Video: https://youtu.be/aGeWSQrF1MU

I didn't see that sample until now. We should review this together and probably do ours similar. I'm still not sure what you did here because I don't see the Activate button.

@angelleye
Copy link
Collaborator Author

@kcppdevelopers Their plugin example on GitHub uses the user's API credentials. We basically need to replicate with their plugin is doing in ours.

I originally said to do this under the Settings -> PayPal for WooCommerce -> General tab. Instead, we need to move this into the Express Checkout settings, because it really only applies to that gateway.

In his plugin you have to click the box to enable, and then it displays the Activate / Modify button. I feel like that's an necessary step and I'm not sure why he's doing that. We should be able to simply display the Activate / Modify button, and use the cid if we have it available. Without a cid the button will say Activate, and with one it would say Modify. So of course we need to save their cid locally once we've obtained it for the user.

@kcppdevelopers
Copy link
Contributor

@angelleye I am done with PayPal Insights and push to dev branch for your review.

@angelleye
Copy link
Collaborator Author

@kcppdevelopers I forgot to add one more thing to this. We need to include an admin notice for this update.

"PayPal Insights now available in Express Checkout! Make sure to activate Insights for valuable analytics about your visitors and increased conversion rates on your site!"

The words "activate Insights" should be a link directly to the Insights section of the EC settings panel.

@angelleye
Copy link
Collaborator Author

@kcppdevelopers I guess they have this integrated into their Express Checkout plugin: https://github.com/trainerbill/woocommerce-gateway-paypal-express-checkout

That's where it was done with API credentials so that they don't have to login. We should install their EC plugin and review the code to see about doing this here too please.

@angelleye
Copy link
Collaborator Author

New official name for this is "PayPal Marketing Solutions" instead of PayPal insights. Also, the integration in their EC plugin has some Terms and Conditions we need to include in ours as well.

image

@angelleye
Copy link
Collaborator Author

@kcppdevelopers I'm still not seeing API credentials included so that we don't have to sign in to activate insights..??

Did you install the EC plugin that they have and check it out? They are adamant that it uses API credentials so you don't have to sign in, and that's what they're asking us for here. When I run a test, though, it's still bringing up a login window..??

@angelleye
Copy link
Collaborator Author

@kcppdevelopers It's also still making me type in my website address. Can't we pass the {site_url} so that it gets pre-filled for us?

@angelleye
Copy link
Collaborator Author

@kcppdevelopers I think maybe I haven't been clear on what we need to do here. Let me try to explain again what's going on here.

Woo has their own PayPal Express plugin available in the WP directory: https://wordpress.org/plugins/woocommerce-gateway-paypal-express-checkout/

One of the PayPal reps forked that repo to his own, and he built in the PayPal Insights functionality: https://github.com/trainerbill/woocommerce-gateway-paypal-express-checkout

When running that forked version of the plugin, we see this inside the Express Checkout Settings:

image

We need ours to look and function like this, except we should try to improve it where possible. For example, if we can pass the site_url to pre-fill the dialogs that would be good.

@angelleye
Copy link
Collaborator Author

@kcppdevelopers I installed their forked copy of the plugin, and I see it's still asking me to login when I click to Activate / Manage Insights, so I've asked them for clarification on how that is supposed to be working.

We just need to go ahead and add this additional marketing stuff along with the terms and conditions you already added the same they've done. Notice it adjusts when you click Enable...

@angelleye
Copy link
Collaborator Author

@kcppdevelopers I pulled the dev branch, which only had a change in the main plugin file. I uploaded that and ran another activation of Marketing Solutions, but I don't see any log file. I also don't see any commit that includes logging..??

@angelleye
Copy link
Collaborator Author

angelleye commented Nov 13, 2017

@kcppdevelopers When I click the button to clear the Marketing Solution data (CID) it's actually wiping out the live API credentials, too. Looks like it may have wiped out my sandbox credentials, too..??

@angelleye
Copy link
Collaborator Author

angelleye commented Nov 13, 2017

@kcppdevelopers For some reason now I am not getting the banners to show up at all, even when I clear site data via Chrome Console -> Application -> Storage -> Clear Site Data. Not sure if this has something to do with the new params that were added in 580c225..??

      "configuration": [
        {
          "id": "analytics-id",
          "value": "abcd-1"
        },
        {
          "id": "variant",
          "value": "slide-up"
        },
        {
          "id": "flow",
          "value": "credit"
        },
        {
          "id": "mobile-flow",
          "value": "credit"
        },
        {
          "id": "is-mobile-enabled",
          "value": "true"
        },
        {
          "id": "is-desktop-enabled",
          "value": "true"
        },
        {
          "id": "limit",
          "value": "3"
        }
      ]

@angelleye
Copy link
Collaborator Author

If we go back to JS integration we need to add the following:

image

@angelleye
Copy link
Collaborator Author

angelleye commented Nov 14, 2017

  • Fix API credentials from getting wiped out (remove API call from Enable check box, and instead make the API call when the Save button is pushed).
  • Resize pop-up window to the same size as the More Info graphic
  • Adjust log file so that the JSON request is formatted in a friendly / readable way.

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

No branches or pull requests

1 participant