Installing the Pixlee Magento 2 Extension

Get Your Pixlee API Keys

Before installing the Pixlee Magento 2 extension, you will need your API Key and Secret Key from http://pixlee.com.

1) First, log in to http://pixlee.com and click on the Settings button inside the top right hamburger menu.

(Alternatively, point your browser to https://app.pixlee.com/app#settings/account_settings while logged in).

Pixlee Dashboard


The settings page should look like this:

Pixlee Settings


2) Click on Pixlee API on the lefthand navigation bar.

From this page, record the values of Account ID, Account API Key, and Account Secret Key.

We’ll need these later.

Pixlee API


3) Now’s a good time to download the Pixlee_Magento2.zip extension file if you don’t have it.


Install the Pixlee Magento 2 Extension

4) Extract the contents of the file downloaded in the previous step in your Magento 2 folder’s app/code folder. Verify that the directory structure looks like <Your Magento 2 folder>/app/code/Pixlee/Pixlee.

5) Open up a command prompt. If you are using Windows, this can be done using Run (CTRL + R) and typing in ‘cmd’. If your are using a OSX, open up the spotlight search using CMD + SPACE and type in ‘terminal’.

Inside the command prompt or terminal, navigate to your Magento 2 folder.

6) Finally, execute the following commands.

php bin/magento module:enable --clear-static-content Pixlee_Pixlee

and

php bin/magento setup:upgrade


Clear the Magento 2 Cache and Cache Storage

7) Open your the Magento 2 Admin Panel and go to ‘System’ and click on Cache Management on the popup menu.

Magento 2

Click on Flush Cache Storage and after that Flush Magento Cache to clear the cache.


Configure the Pixlee Magento 2 Module

Before we can start using the plugin, we need to configure it.

Click on Stores at the left panel of the page and click on Configuration on the popup menu.

Select the website on which you’d like to install Pixlee, using the store view dropdown menu.

Magento 2 Configuration

On the Navigation panel on the left, click on Pixlee and then Existing Customers. You should be redirected to the Pixlee Account Settings page.

Magento 2 Configuration


Now it’s time to use the keys we saved from pixlee.com in step 2.

Fill API Key and Secret Key with the values you recorded earlier.

Click Save Config on the top right corner of the page to save your Account Settings.


Exporting Products from Magento 2 to Pixlee

Conveniently, the Export Products to Pixlee button is right here!

Click it to complete the Pixlee Magento Extension installation.

Export Products

You can export your Magento 2 products to Pixlee at any time from the Export Products to Pixlee button on the Pixlee Account Settings page.

Note: if you have ever changed the max_execution_time variable for Magento, please ensure that it is set to at least 3600 seconds (1 hour). The default should be 18000 seconds, which is fine to leave alone.




Mass Deploying Pixlee Widgets

The extension allows you to mass deploy Pixlee widgets on all of your product and category pages using a few simple steps.

Installing Product Description Page (PDP) Widgets

Assuming that you have now exported all of your products to Pixlee, you can embed a PDP Widget on your product page by doing the following.

1) Go to http://pixlee.com, log in, and navigate to the Products tab of the Albums section.

(Alternatively, point your browser to https://app.pixlee.com/app#products while logged in).

The Products tab looks like this:

Products


2) Click the “INSTALL PRODUCT DISPLAYS”, then PRODUCT PAGES, and follow the on-screen instructions to customize the widget as you wish.

PDP Wizard


3) At the end, you’ll be presented with an embed code.

Pixlee PDP Widget

Copy the value for widgetId in the resulting code snippet. Fill in this value in the Widget ID field inside Admin > System > Configuration > Pixlee Account Configuration. This the same field that we skipped over in Step 10.


4) Now, to implement the Pixlee PDP widget, simlply enter the value next to widgetId from the previous step in the PDP Widget ID field under the PDP Widget Settings section.

Click Save Config on the top right corner of the page to save your Account Settings.

PDP Configuration


With that, any product that has tagged photos in its Pixlee album should now have a widget gallery appear on its product description page.

To further customize, you can re-publish your PDP widget using Pixlee’s Design Editor, and use that resulting widgetId instead!

PDP Example


5) Furthermore, if you’d like to customize the placement of the PDP widget, modify catalog_product_view.xml.

For example, in the Magento 2 sample store (Luma), it’d be in the following file:

$MAGENTO_ROOT/app/code/Pixlee/Pixlee/view/frontend/layout/catalog_product_view.xml

Where $MAGENTO_ROOT might be something like /var/www or /usr/share/nginx/html, depending on your installation.

Installing Category Description Page (CDP) Widgets

Assuming that you have now exported all of your products to Pixlee, you can embed a CDP Widget on all of your category pages by doing the following.

1) Go to http://pixlee.com, log in, and navigate to the Products tab of the Albums section.

(Alternatively, point your browser to https://app.pixlee.com/app#products while logged in).

The Products tab looks like this:

Products


2) Click the “INSTALL PRODUCT DISPLAYS”, then PRODUCT PAGES, and follow the on-screen instructions to customize the widget as you wish.

PDP Wizard


3) At the end, you’ll be presented with an embed code.

Pixlee PDP Widget

Copy the value for widgetId in the resulting code snippet.


4) Now, to implement the Pixlee CDP widget, simlply fill in this value in the CDP Widget ID field inside Admin > System > Configuration > Pixlee Account Configuration > CDP Widget ID.

Click Save Config on the top right corner of the page to save your Account Settings.

PDP Configuration


With that, any product that has tagged photos in its Pixlee album should now have a widget gallery appear on its product description page.

To further customize, you can re-publish your PDP widget using Pixlee’s Design Editor, and use that resulting widgetId instead!

CDP Example


5) Furthermore, if you’d like to customize the placement of the CDP widget, modify catalog_category_view.xml.

For example, in the Magento 2 sample store (Luma), it’d be in the following file:

$MAGENTO_ROOT/app/code/Pixlee/Pixlee/view/frontend/layout/catalog_category_view.xml

Where $MAGENTO_ROOT might be something like /var/www or /usr/share/nginx/html, depending on your installation.




Testing and Troubleshooting

To test that everything was implemented correctly, we need to check two things -

  1. Were all the products exported?
  2. Are API calls being successfully made to the Pixlee API?

Were all the products exported?

Before testing, please make sure that the Pixlee Product Exports job has at least ran once. If you’ve already ran the exports once, skip to step 3.

1) In order to run it manually. Open Admin Panel > Stores > Configuration > Pixlee > Existing Customers. Press the Export Products to Pixlee button to start the exports.

Export Products

2) Login to Pixlee and navigate to Products under the Album tab. Alternatively, click this link..

3) You should see a list of products on this page.

Exported Products

5) Try searching for a few products on this page that you know exist in your catalog.

6) In case the list is empty or you were not able to search for a particular product, proceed to the next step. Otherwise proceed straight to the next section i.e. Are API calls being successfully made to the Pixlee API?

7) There can be several causes of failure to export products so first we need to find out the exact cause of the failure. The Pixlee Product Exports job logs the progress and all exceptions to the server logs. So the next step for us is to get the both Magento server logs and the PHP (Apache or equivalent) logs.

8) The Magento server logs are usually located at $Magento_Root$/var/log so navigate to that location and look for file named system.log.

9) For the PHP logs location it depends on your setup. For example, if you’re using Apache the logs should be in $Apache Root$/logs. We’re looking for the file named php_error.log in this directory.

10) One of the most common issues that we encounter is a lack of allocated memory to the Magento or PHP/Apache server. Open the php_error.log file using your favorite text editor and search for a log entry similar to the following line

Allowed memory size of 33554432 bytes exhausted (tried to allocate 43148176 bytes) in php

11) If you found a similar looking error, please increase the allocated memory and run the product export job again.

12) Another common issue we encounter is a low setting for the max_execution_time. Look for a log entry similar to the following

Fatal error: Maximum execution time of XYZ seconds exceeded in ...

13) If you found a similar log entry please increase the max_execution_time setting inside your php.ini file to at least 3600. And then try exporting the products again.

14) If at this point you’re still not able to see any products exported to Pixlee, please contact us at support@pixleeteam.com and attach the both sytem.log and php_error.log with the email.

Are API calls being successfully made to the Pixlee API?

API calls are made to Pixlee API when a customer adds something to their cart and when they buy something on your store. We need to make sure that these calls are being made at the right time.

1) Open your favorite browser and open a product page of your store. And click Add to Cart.

Product Page

2) Open the system.log file located at $Magento_Root$/var/log using your favorite text editor and scroll down to the very end.

3) There should be an entry beginning with [Pixlee] :: addToCart

ATC logs

4) If you found the addToCart calls then your analytics were integrated correctly. If not, contact us at support@pixleeteam.com and attach the system.log file with the email.

5) Switch back to the browser and proceed to checkout and buy the product that you added to cart previously. Use a test payment method for the checkout.

6) When you reach the order confirmation page switch open the sytem.log file again and ensure that you viewing the latest copy of the file.

7) This time look for log entries beginning with [Pixlee] :: checkoutSuccess

Conversion logs

8) If you do not see the [Pixlee] :: checkoutSuccess calls like in the screenshot, please contact us at support@pixleeteam.com and attach the sytem.log file with the email.