All Collections
Integrations
Shopify
Shopify Integration Setup
Shopify Integration Setup

Learn how to setup your Shopify store with Cometly.

Updated this week

Start Here πŸ‘‹

Ready to get Cometly marketing attribution installed on your Shopify store? In this article we will walk you through step-by-step for how to implement the tracking setup. Please start by watching the video below so you can learn more about how the integration works and decide the events you would like to setup for tracking.

Important:

  1. Shopify uses specific UTM parameters. Please use this help article for step-by-step setup instructions.

  2. If you have Legacy Cometly Shopify code scripts installed on your store, please visit this article to learn how to remove & replace with the new script.

Step 1: Install the Cometly base code pixel on your store

To install the Cometly base code pixel in your Shopify store:

  • Navigate to Setup in your Cometly space

  • Copy the Cometly base code pixel

  • Paste base code pixel before the </head> in the theme.liquid file

If you would like to install the Add To Cart and Initiate Checkout events, you will need to setup the Cometly base code pixel using Google Tag Manager.

Step-by-Step Instructions

Login to your Shopify store and under Sales Channels, click Online Store > Themes

Next to Customize button, click the three dots and then click Edit code as shown in the image below to access your code editor:

On the left panel, choose theme.liquid

Navigate to the Setup section inside your Cometly space and copy the Cometly base code pixel from Step 1:

Important: Each Cometly space has a unique pixel. If you have multiple stores and have created different spaces, ensure that you are placing the code from the correct space.

Search the theme.liquid for </head>. You want to ensure that you place the Cometly base code pixel before the </head>.

Click Save after you have placed the base code pixel.


Step 2: Connect your integrations

To connect your Shopify store to your space, login to Cometly and click Space Settings > Integrations. Find the Shopify integration and paste your myshopify store URL and click Connect.

The video below explains exactly how to do this step-by-step:

Step-by-Step Instructions

Connect to ad channels

To connect your integrations, simply navigate to the Space Settings page to view all your connected integrations. To connect to your ad channels, click the "Manage Connections" link to go to the profile integrations page. From this page you can connect to your different ad channels by clicking the blue "connect" button next to the Ad Channel that you need to connect. You will be redirected to the ad channel platform where you will just need to click "Accept" before being redirected back into Cometly.

Connect your ad accounts to the Workspace

Once your Ad Channels have been connected, navigate back to the Space Settings Page

and click the green "Connect" button next to the ad account that you want to connect to the workspace for this specific Shopify store.

Connect your Shopify store to the Workspace

To connect your Shopify store to the space, add in the website URL for your Shopify store and click the "connect" button. You will be redirected to the Shopify store where you will be prompted to Install the Cometly app. Once that is complete, you will be redirected back to Cometly where you will see that the Shopify store is now "connected":


Step 3: Setup UTM Parameters on your Ads

Important: Shopify has specific URL parameters for setup that are different from other Cometly integrations. Ensure that you use the correct URL parameters outlined below.

Setting up your UTM parameters correctly is essential for accurate attribution with Cometly. If any of your ads are not set up correctly then Cometly will not be able to track a portion of your sales (i.e. Cometly will not track any purchases from an ad if it does not have the correct UTM set up).

A) Select Your UTM Parameter Configuration

For All Shopify Spaces: You must make a UTM selection for the dynamic {{ad.id}} or purchases will not track. Please follow the easy steps below:

To make a selection, please visit the Shopify Integration page in Cometly and follow the steps below:

Important: When you make the selection below, the parameters you can copy above will change depending on your selection. You can edit your configuration at any time. You must make a selection for the ad.id or Cometly will not track.

  • Select the parameter for the dynamic {{ad.id}}

  • Click Save

  • Ensure you have selected your UTM configuration. You can assign any of the following UTM parameters to the {{ad.id}}:

    • utm_campaign

    • utm_medium

    • utm_content

    • utm_term

    • ref

  • utm_source can be one of the following, though we recommend you use the dynamic site_source_name:

    • {{site_source_name}}

    • facebook

    • google

    • tiktok

  • After you have selected your UTM configuration, the parameters will automatically configure so you can easily click Copy Code and add them to your Website URL, tracking template, or tracking section (depending on the ad channel).

B) Choose The Ad Channel You Want To Set Up First

Setup UTM Parameters on your Meta Ads

The following UTM parameters are required on every Meta Ad that you want to track with Cometly:

utm_source={{site_source_name}}&utm_medium={{ad.id}}

To set these up inside the FB Ads manager, navigate to the ad level and select an ad that you want to track with Cometly. At the ad level, find the Tracking section and paste the above UTM parameter code into the URL parameters box:

Important: If you want to track Carousel Ads, Catalogue Ads, Existing Post Ads, or if you have a link to your store in the ad, please see the instructions below.

Carousel Ads β†’ setup instructions

  • Multiple Website URL's

Catalogue Ads β†’ setup instructions

  • Dynamic Website URL's

Existing Post Ads β†’ setup instructions

  • Running ads as an existing post

Store Link In Ad Copy β†’ setup instructions

  • URL in the ad copy

PLEASE NOTE: Make sure you do not use any of the same parameters more than once in your UTM string (i.e. do not use utm_content={{ad.id}} AND utm_content=paid in the same UTM string).

Now you can go ahead and publish your ad. As long as you use this setup process on EVERY ad, your tracking and attribution with Cometly will be accurate.

Setup UTM Parameters on your Google Ads

Important: Any Performance Max campaign , Shopping campaign, or other campaign types that do not have an ad level or a have a dynamic ad level, you must use the Smart campaign tracking template below.

For Search Campaigns

Cometly needs the following UTM parameter code attached to the end of every Website URL in the 'Tracking Template' section of each of your search campaigns:

{lpurl}?utm_source=google&utm_medium={network}&utm_campaign={campaignid}&utm_content={creative}&utm_term={keyword}

For Performance Max & Shopping Campaigns

  • Any Performance Max campaign , Shopping campaign, or any other campaign types that do not have an ad level or a have a dynamic ad level, you must use the Smart campaign tracking template below.

Cometly needs the following UTM parameter code attached to the end of every Website URL in the 'Tracking Template' section of each of your campaigns:

{lpurl}?utm_source=google&utm_medium={network}&utm_campaign={campaignid}&utm_content={creative}&utm_term={keyword}&ref=smart

To set these up inside the Google Ads manager, navigate to Settings > Campaign Settings and select the campaigns that you want to track with Cometly. Then click Edit > Change tracking templates.

Ensure you set up the tracking template at the campaign level so all of your ad groups and ads automatically have the tracking template applied.

Change Tracking Template In Google Ads

Then you should see a box labeled New tracking template and this is where you will need to place the UTM parameters listed above.

New Tracking Template In Google Ads

Once those parameters have been pasted, you can click "Apply" to apply those changes.

Apply New Tracking Template In Google Ads

Setup UTM Parameters on your TikTok Ads

Cometly needs the UTM parameter code attached to the end of every Website URL in the "Destination page" section of each of your TikTok ads:

?utm_source=tiktok&utm_medium=__CID__

To set this up inside the TikTok Ads manager, navigate to the ad level and select an ad that you want to track with Cometly. There should be a section titled "Destination page" with a box for "Website URL".

Add UTM Parameters On TikTok Ads

Simply "copy" the above code (include the "?") and "paste" the code at the end of your Website URL in that section.

PLEASE NOTE: Make sure you do not use any of the above parameters more than once in your UTM string (i.e., do not use utm_content=__CID__ AND utm_content=paid in the same UTM string).

If there is another ? in your Website URL, that means you are already using UTMs, so you would need to switch the first "?" to a "&" before adding it to the end of your Website URL:

i.e. if your Website URL is

www.test.com?variant=12345667

then instead of

?utm_source=tiktok&utm_medium=__CID__

you would want to add

&utm_source=tiktok&utm_medium=__CID__

So your Final website URL would be

www.test.com?variant=12345667&utm_source=tiktok&utm_medium=__CID__

Now you can go ahead and publish your ad. As long as you use this setup process on EVERY ad, your tracking and attribution with Cometly for TikTok ads will be setup correctly.

Please reach out to support with any questions about setting up the UTM parameters on your TikTok Ads.

If you do not want to use the default UTM tracking parameters provided by Cometly, and you are already using Ad ID and Site Source in your existing UTM parameter setup, then you can configure the UTMs in Cometly to reflect your current setup by following the instructions in this article.


Step 4: Import existing ad campaigns and turn on tracking

The Import Campaigns page is a tool that allows Cometly to track existing campaigns that were created before you had Cometly. Cometly cannot track retroactively, so all metrics will be tracked starting at the moment that you turn tracking β€œON”.

After turning tracking on, you will see your campaigns in Ads Manager. It will take between 30-60 minutes to start receiving data.


Step 5: Activate Cometly Conversion API For Shopify

Considerations for using Cometly's Meta Conversion API:

  • You can only use ONE conversion API with Meta. If you want to use Cometly's Meta conversion API, you need to ensure you DO NOT have any other conversion API's enabled.

  • Cometly's Meta conversion API will NOT send page view events. You need to ensure you have your Meta pixel in the <head> across all pages of your site so the Meta pixel will track browser page view events.

  • When the Cometly Meta conversion API is enabled, Cometly will automatically send any tracked events back to the pixel associated to the ad that we tracked the event to.

Example Best Setup:

  • Meta pixel in the <head> of all pages of your site sending page view events to Meta.

  • Cometly sending all other events back to Meta's server for your pixel.

If you want to use the Cometly's Meta Conversion API, you will have to turn off data sharing for the native Meta Shopify Conversion API.

  • If you turn off data sharing, you must install the Meta pixel in the <head> of all pages of your site so you will still send page view events to Meta.
    ​

Did this answer your question?