# Integrate Sirv Spin with Google Analytics and Facebook pixel

You can measure the impact that [360 spins](/help/spin/getting-started/how-spin-files-are-created/) have on your conversion rate by tracking user interactions with your spins.

Using an AI coding agent?

Install the [`sirv-360-spin`](https://www.skills.sh/sirv/image-optimization-skill/sirv-360-spin) skill, and your agent can add and set up your spins. Ask in plain words, such as “Add our 360 spins to the product pages.” [See all 8 skills](/help/rest-api/sirv-skills-for-ai-agents/)

You might also want to set up remarketing campaigns in Google and Facebook ads, to target users who have previously interacted with your 360 spins.

### Tracking code

First, make sure that your tracking code is working correctly. This is important - if your tracking code isn’t correctly implemented your data won’t be of use.

Refer to the official [Google Analytics guide](https://support.google.com/analytics/answer/1008015?hl=en) for configuring tracking. You can also send the events through [Google Tag Manager](/help/spin/analytics-tracking/how-to-integrate-sirv-spin-with-google-tag-manager/).

For Facebook pixel installation, follow the [Facebook pixel guide](https://www.facebook.com/business/help/952192354843755).

### Set up Sirv callbacks

Add Sirv Event tracking code to your product pages, using this integration code:

```javascript
<script>
/* Triggers when the spin is loaded. */
Sirv.on('spin:ready', (spin) => {
  ga('send', {
    hitType: 'event',
    eventCategory: 'Sirv',
    eventAction: 'Spin loaded',
    eventLabel: 'event.sirv.spin.loaded'
  });
  /* Send a custom event to Facebook */
  fbq('trackCustom', 'Sirv Spin Loaded');
});
/* Spin rotated event pushed to GA */
Sirv.on('spin:rotate', (spin) => {
  ga('send', {
    hitType: 'event',
    eventCategory: 'Sirv',
    eventAction: 'Spin interaction',
    eventLabel: 'event.sirv.spin.interaction'
  });
  /* Send a custom spin event to Facebook */
  fbq('trackCustom', 'Sirv Spin Interaction');
});
</script>
```

Place that code after the references to sirv.js, Google Analytics and/or your Facebook pixel.

You are not limited to these two Sirv Spin events - here’s the [full list of event callbacks](/help/sirv-media-viewer/advanced-implementation/events/#spin-events).

### Set up event based goals in Google Analytics

Now you can turn your events into goals. This will help you clearly see how your users interact with your spins.

We recommend you follow the official [Google goal guide](https://support.google.com/analytics/answer/1032415?hl=en).

![Google Analytics goal set up](https://sirv.sirv.com/website/Help%20center/GA-1.png?profile=screenshots-grey-border)

Additionally, you can [import these goals to Google Ads](https://support.google.com/analytics/answer/1034306?hl=en) and retarget visitors based on this information.

For example, you can show ads to people who have interacted with your spins, or vice versa.

### Set up Custom Audiences in Facebook

In Facebook, you can create a custom audience of people who have interacted with your spins. Then you can target your ads to those people, or exclude them from your ad campaigns.

![set up a custom audience in Facebook](https://sirv.sirv.com/website/Help%20center/facebook-custom-audience-website-traffic.png?profile=screenshots-grey-border)

Follow the official [Facebook guide](https://www.facebook.com/business/help/666509013483225) to creating a custom audience. Choose people who triggered (or didn’t) Sirv Spin events. That’s it.

You can use that audience to create remarketing campaigns, with [personalized images](/help/guides/image-personalization-facebook-messenger/) for each person.
