Skip to main content

Hi guys! I'm having trouble since the past week trying to set up the in-app functionality. My process is stuck at stage 2 of the initial configuration when you hace to choose your channels. The snippet is correctly installed (I can see it is fired on every page in debug mode) but Customer.io doesn't recognize it. I tried this 2 snippets:

1- This one is from the documentation page 

 !function(){var analytics=window.analytics=window.analytics|||];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Snippet included twice.");else{analytics.invoked=!0;analytics.methods=="trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware"];analytics.factory=function(e){return function(){var t=Array.prototype.slice.call(arguments);t.unshift(e);analytics.push(t);return analytics}};for(var e=0;e<analytics.methods.length;e++){var key=analytics.methodsse];analyticsskey]=analytics.factory(key)}analytics.load=function(key,e){var t=document.createElement("script");t.type="text/javascript";t.async=!0;t.src="https://cdp.customer.io/v1/analytics-js/snippet/" + key + "/analytics.min.js";var n=document.getElementsByTagName("script"))0];n.parentNode.insertBefore(t,n);analytics._writeKey=key;analytics._loadOptions=e};analytics.SNIPPET_VERSION="4.15.3";
analytics.load(
"YOUR_API_KEY",
{
"integrations": {
"Customer.io In-App Plugin": {
siteId: "YOUR_SITE_ID"
}
}
}
);
analytics.page();
}}();

2- And this one is from the sources page

<script>
!function(){var analytics=window.analytics=window.analytics|||];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Snippet included twice.");else{analytics.invoked=!0;analytics.methods=="trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware"];analytics.factory=function(e){return function(){var t=Array.prototype.slice.call(arguments);t.unshift(e);analytics.push(t);return analytics}};for(var e=0;e<analytics.methods.length;e++){var key=analytics.methodsse];analyticsskey]=analytics.factory(key)}analytics.load=function(key,e){var t=document.createElement("script");t.type="text/javascript";t.async=!0;t.src="https://cdp-eu.customer.io/v1/analytics-js/snippet/" + key + "/analytics.min.js";var n=document.getElementsByTagName("script"))0];n.parentNode.insertBefore(t,n);analytics._writeKey=key;analytics._loadOptions=e};analytics.SNIPPET_VERSION="4.15.3";
analytics.load("MY API KEY");
analytics.page();
}}();
</script>

Had anyone a similar problem? I don't know what else to try.

Hi Sebastian,

Byron here from the technical support team. I understand you’re trying to implement our in-app messaging feature on your website via GTM, is that right? In the info you provided above, the first script would be the one you want to use, which has the in-app messaging feature plugin enabled with the snippet below

analytics.load( "YOUR_API_KEY", { "integrations": { "Customer.io In-App Plugin": { siteId: "YOUR_SITE_ID" } } } );

 

This script works for our JS Source in Pipelines. Do you have the JS Source set up and enabled in CDP? If so, you’ll also want to verify you’re using the correct API key (For the JS Source, not for your Journeys workspace) and Site ID (this is the same for Pipelines and Journeys).

 

Are you seeing any errors on the page or in the script? 


Hi Byron. Thanks for your answer. I changed the tag to the one you told me but still not work. I checked both site ID and API key and I’m using the correct ones.

The tag fires well on my pages and doesn’t have an error nor in Customer.io or GTM. This is driving me crazy haha.


Hello,

Can you also confirm that your site is identifying people?

https://customer.io/docs/cdp/sources/connections/javascript/js-source/#identifying-users

 

When you’re logged into your site, if you can open the Application tab and view Cookies, you should see ajs_user_id cookie that will contain the identifier (more info here: https://customer.io/docs/cdp/sources/connections/javascript/js-source-cookies/)

 

You’ll then want to use that identifier to try to send a test in-app message -- I would try even if the UI shows that your app is not connected.

 

Can you also confirm that your JS source in Pipelines is showing activity in the data-in tab?


Hi Byron. I can see the cookie with that name but that id doesn’t correspond to any user.

In Customer.io dashboard, my user has this data

And, as you can see, the app is populating data.

 


Reply