# Asset download not tracked

**URL:** <https://forum.mautic.org/t/asset-download-not-tracked/14907>\
**Category:** Product Support\
**Created:** [June 22, 2020, 3:22pm UTC](https://forum.mautic.org/t/asset-download-not-tracked/14907 "2020-06-22T15:22:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![backseat](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/backseat/32/1863_2.png) [@backseat](https://forum.mautic.org/u/backseat)\
**Post date:** [June 22, 2020, 3:22pm UTC](https://forum.mautic.org/t/asset-download-not-tracked/14907/1 "2020-06-22T15:22:46Z")

</div>

**Your software**  
My Mautic version is: v2.16.2  
My PHP version is: v7.3.14

**Your problem**  
My problem is: I have a PDF asset that users can request by filling in  
a form (Gravity Forms → Zapier → Mautic), which works. I send the  
asset download link by mail to the user from within Mautic. The  
following happens:

- The asset downloads correctly
- Mautic shows the contact has opened the mail, but not that they  
have downloaded the asset.
- The asset\_downloads table is empty
- The asset page does show the correct number of downloads
- The user doesn’t get added to a segment of users who have  
downloaded that asset

These errors are showing in the log: none - in fact, there’s no entry  
at all in the logs. The Apache log shows the asset being downloaded.

Steps I have tried to fix the problem:

- I’ve checked that the link in the email is encoded by Mautic (it  
is).
- I’ve ensured that the user receiving the email is not logged into  
Mautic (they don’t have a Mautic account, but I logged out anyway)
- I tried to follow the code page but got lost at index.php(!). If  
someone can point me to where in the codebase to look, I’ll try  
some debugging.

---

<div class="post-metadata">

**Author:** ![backseat](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/backseat/32/1863_2.png) [@backseat](https://forum.mautic.org/u/backseat)\
**Post date:** [June 24, 2020, 7:29pm UTC](https://forum.mautic.org/t/asset-download-not-tracked/14907/2 "2020-06-24T19:29:20Z")

</div>

I’ve found an error in the Apache log. This error is repeated every time the asset is downloaded. Can anyone shed any light on this?

`[Wed Jun 24 20:19:58.144496 2020] [proxy_fcgi:error] [pid 27810:tid 140140244576000] [client 2001:678:32c:57af::1005:59668] AH01071: Got error 'PHP message: Doctrine\\ORM\\ORMInvalidArgumentException: A new entity was found through the relationship 'Mautic\\AssetBundle\\Entity\\Download#lead' that was not configured to cascade persist operations for entity: Mautic\\LeadBundle\\Entity\\Lead with ID #. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity or configure cascade persist this association in the mapping for example @ManyToOne(..,cascade={"persist"}). in /var/www/ems/vendor/doctrine/orm/lib/Doctrine/ORM/ORMInvalidArgumentException.php:92\nStack trace:\n#0 /var/www/ems/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(852): Doctrine\\ORM\\ORMInvalidArgumentException::newEntityFoundThroughRelationship(Array, Object(Mautic\\LeadBundle\\Entity\\Lead))\n#1 /var/www/ems/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(740): Doctrine\\ORM\\UnitOfWork->computeAssociationChanges(Array, Object(Mautic\\LeadBundle\\Entity\\Lead))\n#2 /var/www/ems/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(452): Doctrine\\ORM\\Unit...'`

---

<div class="post-metadata">

**Author:** ![backseat](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/backseat/32/1863_2.png) [@backseat](https://forum.mautic.org/u/backseat)\
**Post date:** [June 25, 2020, 1:33pm UTC](https://forum.mautic.org/t/asset-download-not-tracked/14907/3 "2020-06-25T13:33:00Z")

</div>

How can I move this forwards?

Either I misunderstand what Mautic should be able to do, or there’s a configuration problem or there’s a bug.

If someone would point to where in the code asset tracking is implemented, I’ll try to dig deeper.

Thanks.

---

<div class="post-metadata">

**Author:** ![backseat](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/backseat/32/1863_2.png) [@backseat](https://forum.mautic.org/u/backseat)\
**Post date:** [June 27, 2020, 1:08pm UTC](https://forum.mautic.org/t/asset-download-not-tracked/14907/4 "2020-06-27T13:08:26Z")

</div>

I’ve now set up a virgin 2.16.2 installation to try this. The good news is that I don’t get any errors anywhere. The bad news is that it still doesn’t work.

Really looking for a way to move this forwards. What can I do to help?
