Shopify
Documentation for adding Emplifi's Pixlee TurnTo Social UGC to your Shopify store
Browser Compatibility Notice
Firefox currently has compatibility issues with the installation of the plugin. For the purpose of the below instructions, we recommend Chrome or Safari instead. Also make sure your browser settings allow cross site scripting and third party cookies in order to access the app (this situation usually only occurs for Safari).
Prerequisites for Safari
- Make sure that cross site tracking is enabled:
- Open Safari preferences.
- Navigate to the Privacy tab.
- Make sure “Prevent cross-site tracking” is not selected.
- Make sure to disable cross origin restriction:
- First make sure the develop option appears on your menu bar.
- Open Safari Preferences.
- Go to the Advanced tab and select “Show Develop menu in menu bar”.
- Go to the Develop tab in your menu bar and select “Disable Cross-Origin Restrictions”.
Install Emplifi's Pixlee TurnTo Social UGC app to your Shopify Store
In order to add order to add UGC content and analytics to your Shopify store, you will need to install the Pixlee TurnTo Social UGC Application in your Shopify store.
- Log into the Shopify admin panel for your Shopify store
- Search for the Pixlee TurnTo Social UGC Shopify app
- Click install in the app listing and then install the app in your store admin
- Click Install app in your store admin
Configuring your Pixlee TurnTo Social UGC app
Once the app is installed, you will need to enter your credentials in the app configurations in order to connect to your Pixlee account.
-
Open the Pixlee TurnTo Social UGC app in your Shopify store which should open to the app configurations page
-
Enter your *Base websites URL** in the format https://yoursite.com
-
Enter your Pixlee API Shopify Token. See Get your API Keys for help accessing your token
-
Click Save
After successfully saving your URL and Shopify Token, you will be able to access your app's Dashboard page. The app will automatically begin exporting your store's product data to Pixlee. Once this process is complete, you will see a green checkmark next to Products in sync in your Dashboard's Setup section. The rest of the checkmarks will appear within 24 hours of fully implementing widgets and analytics in your store. In case they don't or in the future if they become red for any reason, contact support here.
Analytics
Javascript Analytics
In order to add the required javascript to the store frontend, you must Enable App Embed. The javascript is also required to display UGC widgets.
Conversion Analytics
Conversion analytics are captured by the app and do not require javascript. Conversion capture is enabled by default. Contact your customer success manager or support to have the feature disabled.
WARNING: The updated Shopify checkout does not allow script tags or app embed added javascript. We are working on a checkout extension to handle conversion analytics in the new checkout. Until then, follow instructions for Reverting to old Shopify checkout.
Enable App Embed
In order to add the javascript required for UGC widgets and analytics, you must enable the App Embed in your store's theme.
-
In your Shopify store admin, open Sales channels > Online Store in the left navigation panel and select Themes
-
In the theme editor, click the App Embed button in the far left nav panel
-
Switch on the toggle for Emplifi Analytics/Widget to enable the app embed
Reverting to old Shopify checkout
App Embeds do not work in the new Shopify checkout. In order to add the necessary javascript to capture conversions, you will need to use the old version of checkout. If you are already using the old checkout, no changes are needed.
- In the store admin, click the Settings link in the bottom left corner
- In the settings select Checkout from the menu
- Scroll down to Order status page additional scripts at the bottom of the checkout settings
- If the Order Status scripts is in the middle of the settings and has a text field, then you are already using the old checkout and the javascript will be added by the app embed.
- Click the additional scripts link to revert your checkout
- After reverting checkout, you will see a text field in the Order status page additional scripts settings and you should see
pixlee.shopify.v2.prod.js
loaded in the checkout Thank You page
Setup Widgets in Pixlee
Once all of your products have been exported to Pixlee, you will be able to set up widgets in your Pixlee account to add to your site.
- Log in to http://pixlee.com
- Navigate to the Publish Center in the top navigation bar
- Customize the widget as desired and save the widget.
Note: We recommend that you leave the "Load Priority" setting to "Low priority" when customizing.
Embedding a PDP, CDP, and Simple Widgets on your site
Steps for Shopify's Theme 2.0 themes
NOTE: Only one widget block of any type can be added to a single page. To add more than one widget to a page, the custom javascript must be added manually.
-
In order to enable widgets, you must Enable App Embed
-
In your Shopify store admin, open Sales channels > Online Store in the left navigation panel and select Themes
-
On the Themes page, click the Customize button for the theme
-
In the theme editor, open the page selector dropdown in the center of the top navigation bar and select the page you want to add the widget to
-
For the PDP widget, select Products > Default Product
-
For the CDP widget, select Collections > Default Collection
-
For Simple widgets, you can select any page
-
-
In the Template section of the editor, click Add Block in section you want the widget to or click Add Section to create a new section with the widget block
-
Once the block is added, click the block to open the block settings
- PDP Widget
- Widget ID - The ID from Publish Center
- CDP Widget
- Widget ID - The ID from Publish Center
- Simple Widget
- Widget ID - The ID from Publish Center
- Fallback Album ID (optional) - Album ID to use if fallback threshold is not met
- Fallback Threshold (optional) - Number of media items in album to use fallback album
- PDP Widget
Steps for vintage themes
After you Setup Widgets in Pixlee, press the "Generate Embed Code" button and you will be presented with an embed code. This script needs to be customized to work on Shopify product pages.
PDP Widget for Product Page
Copy the embed code from above and replace the skuId:"<= ENTER YOUR SKU ID CODE >"
property with ecomm_platform:"shopify"
in the Pixlee.addProductWidget()
function. The resulting code should look like
<div id="pixlee_container"></div>
<script type="text/javascript">
window.PixleeAsyncInit = function() {
Pixlee.init({apiKey:"<ACCOUNT API KEY>"});
Pixlee.addProductWidget({
accountId:<ACCOUNT ID>,
widgetId:<WIDGET_ID>,
ecomm_platform:"shopify"
});
}
</script>
<script src="https://assets.pxlecdn.com/assets/pixlee_widget_1_0_0.js"></script>
CDP Widget for Collection Page
Copy the embed code from above. Replace addProductWidget
with addCategoryWidget
, remove the skuId
and accountId
and replace them with nativeCategoryId:{{ collection.id }},
and ecomm_platform:"shopify"
. The resulting code should look like
<div id="pixlee_container"></div>
<script type="text/javascript">
window.PixleeAsyncInit = function() {
Pixlee.init({apiKey:"<ACCOUNT API KEY>"});
Pixlee.addCategoryWidget({
widgetId:<WIDGET_ID>,
nativeCategoryId:{{ collection.id }},
ecomm_platform:"shopify"
});
};
</script>
<script src="https://assets.pxlecdn.com/assets/pixlee_widget_1_0_0.js"></script>
For Both Widgets
-
Log in to your Shopify store
-
Open Online Store on the left navigation panel and click Themes
-
In Themes, click the ... button next to Customize and select Edit Code from the dropdown.
-
In the editor, scroll down to the appropriate liquid file for where you want to add the widget. Paste the appropriate code snippet created above into the page where you want the widget to show.
-
For PDP Widget, edit
product.liquid
-
For CPD Widget, edit
collection.liquid
-
Adding Comments Widgets
Checkout comment capture is an add-on feature that requires additional setup. Contact your customer success manager or support to have the feature enabled.
Adding Comment Capture to Checkout
Once enabled you will need to add code to your checkout Order status page. In your Shopify store admin, go to Settings and select Checkout in the menu. Scroll down to the Order status page section and enter the following code in Additional scripts.Update the locale
property if the store locale is not "en_US" which is the default. If your account has multiple regions, contact your customer success manager or support to obtain your region IDs. Uncomment the regions
property and add the region IDs between the []
.
{% if first_time_accessed %}
<script>
var orderData = {
// locale: "en_US",
// regions: ["####", "####]],
orderId: "{{ order.id }}",
email: "{{ order.customer.email }}",
postalCode: "{{ order.shipping_address.zip }}",
firstName: "{{ order.customer.first_name }}",
lastName: "{{ order.customer.last_name }}",
items: [
{% for item in order.line_items %}
{
title: "{{ item.title }}",
url: "https://{{ shop.domain }}{{ item.url }}",
itemImageUrl: "{{ item | img_url: '100x100' }}",
price: "{{ item.original_price | divided_by: 100.0 }}",
sku: "{{ item.sku }}",
variant_id: "{{ item.variant_id }}",
product_id: "{{ item.product_id }}"
},
{% endfor %}
]
}
</script>
<script src="https://shopify.pixlee.com/api/comments/capture?shopify_domain={{ shop.domain }}" async></script>
{% endif %}
Adding Comments Display to Theme 2.0 PDP
Comments captured during checkout can be displayed on the PDP using the Comment Display widget. The app provides a block that can be easily added to the PDP page.
-
Customize the theme
-
In your Shopify store admin, open Sales channels > Online Store in the left navigation panel and select Themes
-
On the Themes page, click the Customize button for the theme
-
-
Edit the Products page
-
In the theme editor, open the page selector dropdown in the center of the top navigation bar and select Products > Default Product
-
-
Add Emplifi Comments Display app block to desired location
-
In the Template section of the editor, click Add Block in section you want the widget to or click Add Section to create a new section with the widget block. Select the Apps tab and choose the Emplifi Comments Display app block to add it to the page.
-
-
Edit the theme block settings
- Click on the Emplifi Comments Display block to display the default settings
- If necessary, update the Widget Locale and Display Locales. Display Locales should be separated by commas ex:
en_CA, fr_CA
. - onFinish is a javascript function that will be called after the widget loads.
Updated about 1 month ago